North Yorkshire Fire & Rescue Service said crews were called out to the stricken service just south of York station, near the city’s racecourse.
A spokesman said 54 passengers and four staff were helped from the train, on to a replacement service.
He said: “When crews arrived, they confirmed a fire had occurred on an express passenger train.
“The fire was in the rear engine. It was extinguished by the train’s own fire prevention system.”
He added: “However, the decision was made to assist with the evacuation of 54 passengers and four staff on to a second train and transport them back to York rail station.
“Fire and rescue crews cooled the rear engine using two foam extensions and checked for residual heat with a thermal image camera.”