I promise not to include Mo in any activity that might be deemed dangerous.
From what I know about you, I can't imagine that you were doing something dangerous. Still, I understand a cop's unwillingness to take a risk on that.
I was doing what cjhsa suggested when I played, I was putting coins on the tracks and letting them get squished. It actually could be dangerous, if the train was going fast enough the coins would sometimes get shot out from under the wheels (made them hard to find so I started taping some of them down).
Another friend of mine who the cops hassled was a Japanese graphic artist in San Diego who was taking pictures around the city with two wooden figurines. She sat them both on the tracks and got a great photo (ended up being a great calendar of the figurines sitting together around San Diego) and the cops really busted her balls over it.
But insofar as them having the right to, well that other friend who got arrested was trying to insist that it was a free country and that they had no right to protect him from himself. That they arrested him makes me believe they reason to believe otherwise and were confident enough about being right on the whole trespassing thing to carry out the threat.
All of that is in stark contrast to here in Costa Rica. There's a track running through the capital that has no barriers, lights or anything. Just runs around town with a badly painted line trying to indicate how close you can drive to it without being hit. The kicker is that the tracks meander through some of the city's main streets (as in the left lane is for cars only when there's no train).
The train almost never runs, but I'd hate to be on those streets when it is. You are forced to share traffic with a frickin' train!