The bus was practically flattened by the force of the impact at a railroad crossing in the city of Cuautitlan, just north of Mexico City. Some of the bodies were so badly mangled that establishing their identities was proving difficult.
"Eleven bodies at the morgue ... have not yet been identified, and it has been difficult to determine their description and their gender, because some are unrecognizable and mutilated," the state attorney general's office in Mexico State — which borders Mexico City — said in a statement.
There were conflicting reports on the number of injured, and how exactly the collision occurred.
State prosecutors said 21 died and that most of the injured were in serious condition at local hospitals. Earlier, state Public Safety spokesman Octavio Campos said 12 people had been pulled alive from the wreck, two of whom later died at the hospital. Other officials said 14 were injured.
State prosecutors said in a news release that the driver of the bus tried to beat the train at a crossing.
But an assistant state prosecutor in Cuautitlan, Alejandro Jardon, told the government news agency Notimex that investigations indicated the bus had stalled as it crossed the tracks, and the driver — unable to restart it — fled as the train approached, leaving passengers to their fate.
The driver was detained two blocks away, shaken but unharmed. The vehicle was operated by a private bus company known as Autotransportes Mexico-Melchor Ocampo SA, according to state prosecutors.
Authorities said the train was pulling 36 empty wagons at the time. The driver and the train conductor were detained for questioning.