The 9.50 TransPennine Express service from Scarborough to Liverpool was forced to stop at Slaithwaite, in West Yorkshire, after the driver reported an engine fault.
A small fire was discovered which was put out by firefighters called to Slaithwaite station.
Nobody was injured and all the passengers were transferred to coaches to complete their journey.
The line did not fully re-open until 3.15pm leading to disruption to a number of TransPennine Express and Northern Rail services.
A TransPennine Express spokesman said: “An engine fault on the 09:50 Scarborough to Liverpool service was reported shortly after the train left Huddersfield.
“The service was stopped at Slaithwaite station and all customers dis-embarked safely and were transferred to coaches.”
The faulty train was taken to a Transpennine Express depot and an investigation into what caused the problem is underway.