One (quite good) reason why it should be an offence is that people do board trains with the intention of stealing luggage and not travelling.
While terrorists are pretty quiet these days, perhaps because our Government is doing a better job of destroying the country by itself, there is also a potential security risk with getting on and off empty trains for no apparent reason.
Sure, it might be an enthusiast wanting to look at the interior or try out the seats, but I'd expect the best thing to do there is notify/ask someone beforehand - in which case you're now also helping reduce the chance of being fined for being there, as well as acting as an extra set of eyes and ears.