I don't think it's any big deal.
I've lost count of the number of times I've seen photos taken by people who had to trespass in order to get the shot. Nobody got hurt in those instances, and no one got hurt here, either. In fact, the OP even states that, when a train did come by, they got the kid out of there. So, it would seem as though there was a degree of caution being used. Some of you folks are acting like the kid was tied to the tracks.
Also, I'm willing to bet the photographer's not a pro, just based on how she's dressed. I don't know any pro who would show up at a portrait session dressed like that. More likely it's a family member with a camera.
My question to the OP, though, is this: If you were so appalled at the complete disrespect for safety and property rights, why were you taking pictures instead of calling the police?