On 13 June 1842, Queen Victoria made the trip from Slough to Paddington, writing in her journal afterwards that it was "delightful and so quick".
The Queen and the Duke of Edinburgh will embark on the same journey on the day of the anniversary.
Joining them will be two descendants of pioneering railway engineers Isambard Kingdom Brunel and Sir Daniel Gooch.
Mark Hopwood, managing director of Great Western Railway, said he was delighted the Queen was marking "this historic anniversary".
"This occasion marks a very special moment in the history of the Great Western Railway," he said.
The Queen will mark the 175th anniversary of the first train journey made by a British monarch.