First, OP, I´d say go on foot, in a city. Few train lines run into Mexico and those that do are higher security and it´d be an easy way to run into a crooked pollero or other unfriendly person. If you´re set on riding in Mexico, which maybe you shouldn´t rush, hop it from down here, and figure out what the hell you´re doing.
Border towns and minimal ID are no problem. I cross regularly with a photocopy of an expired passport, ni pedo. ¨Mexico¨ is not dangerous, life is, the world is. It´s easy to stay safe for some but in much of the world you have to figure out how to defend yourself and, much more importantly, diffuse tense situations, sometimes with cultural and language barriers in play. A passport is a good idea for crossing state lines in southern mexico and going further south. Otherwise, a copy of a birth certificate, SSN card, driver´s license, something helps. Knives longer than 2 inches can get you arrested, and you can be searched anytime so careful where you hide contraband or consider foregoing it. Getting into the States is easy with only a DL or something, or even without if you´re English and your story is good. If they didn´t let you in they´d have a hell of a lawsuit on their ass or something.
I haven´t explored much of Mexico outside of Tijuana, but I´ve lived here the last year and am not leaving anytime soon. After seeing a good chunk of the states and Europe I found TJ to be a much more cultured yet diverse place, strongly affected by US immigration policy but more importantly ripe with viable ways of resisting imperialism.
It´s also really important to understand that much of the violence in Mexico, advertised or not, is a product of US imperialism. Maybe, if you´re comfortable with your privilege and don´t easily get along with others from very different class backgrounds and life experiences, you should be scared. But if you love to see different places, meet people from all over the world, learn language and culture, you´d likely find it fascinating. Tijuana is a wonderful place to start, IMO, and to all of you, my couch is lacking dirty kids..