Brulen. I wouldnt advise taking a railroad if SHTF.
1. In the event of a fuel crisis they are the most efficient way to travel and transport supplies, there will be a lot more traffic.
2. The tracks are absolutely saturated with cameras at every bridge, sensors, air patrols, and work crews. ( i have family who work for railroad etc)
3. being on the tracks with a weapon could = terrorist charge per the new laws that changed here in canada ( no idea elsewhere but they will definitely protect logistic infrastructure), rail roads are frequently targeted by gorillas in occupied countries, with marginal success because they are so closely watched. (supply lines).
4. In non SHTF times rail roads are a magnet for homeless and criminals alike, even if the cameras dont get you, they may rat you out, they like to hide in grain cars, and migrate from inner cities to the coast via rail lines nearly every fall and winter.
5. lots of people have had this same idea.
If shtf and your looking for a walking path out of town, i suggest following the clear cuts that power lines follow. They usually are not well defined on maps, people don’t realize they run for hundreds and hundreds of miles, and the odds of running into someone doing maintenance is very small compared to the rail road. Also, the service buildings and roads are usually well supplied with survival gear and emergency communication equipment. Its not as easy a walk as a rail road, or road. but it beats breaking bush.
Never be afraid to do the righteous thing, nothing righteous is ever easy.