having hopped freight trains for a couple of years (this was a few years ago...), i would say go for it.
most trainyard workers won't care unless you are on/very close to/vandalising one of their buildings or trains. if it is a disused track, i really wouldn't worry.
trespassing or not, as long as you aren't a total a$$, it has been my experience repeatedly that train workers are cool folks and will wave at you more often than yell- which is more than i can say for most of the drivers i encounter on my commute.