Seven employees have been suspended after 22 carriages carrying 1,000 passengers detached from a train and sped backwards for 11km (seven miles) in the eastern Indian state of Orissa.
The runaway carriages were halted by railway staff after they placed rocks on the tracks.
None of the people on the train were injured in the incident, which occurred on Saturday night, officials said.
More than 22 million Indians commute daily on about 9,000 trains.
A video of the incident, caught on a mobile phone camera, showed onlookers screaming as the carriages rolled backwards and past a railway platform.
The suspended employees allegedly did not follow protocol and an investigation has been launched, JP Mishra, a spokesman for the railway ministry, told AFP news agency.
Officials believe that the brakes that are normally applied when a carriage is detached were incorrectly used or overlooked.
"Something ghastly could have happened and it was averted by alert staff," Mr Mishra said.
Such incidents are not uncommon in India. Across the country, trains carry more than 22 million passengers every day but much of the equipment is out of date.
Last November, a group of Indian farmers woke up to find that the train they were travelling on had sped 160km (99 miles) in the "wrong direction". In August 2017, at least 23 people were killed when a train derailed in the northern state of Uttar Pradesh.