People hoping to reach the U.S. ride atop the wagon of a freight train, known as La Bestia (The Beast) in Ixtepec, in the Mexican state of Oaxaca June 18, 2014. Reuters MEXICO CITY (Reuters) - A cargo train used by Mexicans and Central Americans to travel toward the U.S. border derailed in the southern Mexican state of Oaxaca on Wednesday, stranding about 1,300 migrants, emergency services said.

Many of the migrants aboard were young people and nobody was injured when the train nicknamed "the Beast" came off the tracks, a spokesman for local emergency services said.

Since last October, more than 50,000 unaccompanied minors, most from El Salvador, Guatemala and Honduras, have been caught illegally crossing the southwest border of the United States.

Children say that they are fleeing violence at home and hope that they will be able to stay in the United States.

Several days of heavy rain in southern Mexico may have caused the train to derail, authorities said.

(Reporting by Lizbeth Diaz; Writing by Joanna Zuckerman Bernstein; Editing by Lisa Shumaker)