Back in my very idiotic young life messing around the railroad tracks,we have been chased a number of times (Conrail and Amtrak Police). Yes,playing around tracks,climbing cars/riding the rails was stupid.......but so much fun!.
Yep, trains were like a giant kid-magnet for me too.
In Sacramento, where I grew up we kids were always hanging around the tracks.
Whenever a freight, (steam locomotives in this era) was on a siding, summer, 100+ temps, we kids would ride our bikes to the levee and talk to the engineers and they would give us money to ride our bikes to the store and buy cold sodas.
They would let us kids climb up in the cab for awhile...what fun that was!!