If the railroads REALLY have no intention of using those rails again, they usually take them out and either sell the land or donate it to something like RailsToTrails, because they're taxed on them, whether they use them or not.
But sometimes, the rails just look like they're no longer in use, but some RR still uses them occasionally for storage. If you're going to use a section of track and actually walk/bike on the rails, be very, VERY careful. If there are a lot of old deadfalls lying across the rails, there is a reasonable chance that the rails aren't in use, or won't be until they clean them up. Look closely at the tops of the rails themselves, and see if they show signs of recent wear (they don't need to be shiny like mainline tracks to be in use). Are many of the ties rotted or broken? If the rails are still in use, the Federal Railroad Administration (FRA) usually makes the owner take care of the tracks, even on old restored steam trains like this one in WA that offers rides
http://steamtrainride.com/about/ in the summer season.
Also, a few tips about mainline trains:
* Don't tease trains - even when they go into emergency, a train simply can't stop on a dime. Lots of people die from doing this -- stupidity has its rewards.
* Don't assume that one track goes north and the other goes south (or east-west). Whichever railroad owns the rails they operate from one central dispatch, nationally, and they send the trains along the rails according to need: if most of the traffic is going north, they will park the southbound trains on a siding and run the next several trains north ON BOTH TRACKS as long as necessary.
* The tracks are owned and operated by one railroad, and other railroads pay to use them. Around here (W. WA), the BNSF owns most of the tracks, and the UP and Amtrak use them; Amtrak has priority, and can hit speeds up to 80 mph -- they're also much quieter than freight trains, and they hit a lot of dummies who don't think they're going as fast as they are. Smaller railroads use the secondary rails, and speeds are often slower.
NEVER ASSUME ANYTHING ABOUT TRAINS... except that they can kill you if you're not careful. Not getting hit by a train is the easiest thing in the world, but you do have to have a functioning brain, and pay attention.