The train was racing to Kikuyu town with the passengers when the engine caught fire, which engineers believe was caused by an electric fault.
Witnesses and police say quick action by the pilots saved the situation, as it could have been catastrophic had the train continued with its journey.
A witness said the pilots stopped the train and jumped out on sighting the fire and sought the help of the locals and passengers.
“Had the train been on high speed motion, there could have been deaths and injuries. We are lucky because it was detected in time and as the train was almost stopping,” said a witness.
The passengers disembarked and joined locals who had arrived in containing the fire that happened in Mashimoni area of Kibera slums. The area is one of those whose residents are supposed to be evicted to pave way for expansion of the railway.
They managed to contain the fire within a short while before a reinforcement from the railway sheadquarters arrived. Commandant of Railways Police Kirimi Ringera said on Wednesday experts have been called to investigate the cause of the fire and that no one was injured.
“We have ascertained no injury was reported. So far the management of railways is carrying out investigations with experts to establish the cause of the fire because the engine is very expensive,” said Ringera.
Rift Valley Railways officials said another locomotive was later dispatched to the area and picked up the passengers to their destinations.
RVR runs commuter trains on select routes in the city and transports thousands of passengers daily in the morning and evening hours.