All train tracks, whether active or not, are private property. They can’t even legally be crossed on foot except at designated crossings. Police officers can not only give you a ticket and a fine for doing so, but can actually arrest you and haul you in. And the railroads have their own police, who are authorized to do the same.
The fines can be stiff, too. One outraged blogger learned her $6,000 fine was part of a media event surrounding the little-known International Level Crossing Awareness Day, but even ordinary average run-of-the-mill fines can run up to $2,000.