Not all railroad beds revert back to the landowner after they are not used for a railroad any longer. You need to research your deed at the courthouse all the way back to the time when the railroad took control of the property and see what it says. You may need an attorney in some cases but I would see what I could find on your own first.
Second it doesn't matter what state you are in you cannot set bobby traps and have any intent to harm or injure persons, property or equipment without being liable. So be very careful you don't get yourself in trouble.
I have property that I like to keep an eye on and I place bird houses with trail cameras in them in places where I want to monitor the activity. They never notice the cameras in the bird boxes and pictures do fly in court if you get my drift.