There is a long trail in the mountains near where I live. It requires one to walk through a Railway tunnel which is roughly 1.2 miles long and is not straight.
Usually, there is a margin between the train and the walls of the tunnel. The worst margin I have seen is of 4 ft., but that was with two lines (2 tracks), I can simply go to the other track if the train comes on the track where I am walking. If two trains come, one from each direction, Trouble, I'll have to make sure that I stand still between the two tracks (fundamentally wrong and a bad bad idea) or safer lay down between the two tracks, or at the corner of the tunnel wall.
The bast case margin that I have seen in the same section is of 6-8 ft. And there are safety alcoves where the maintenance guys stand while the train passes. I am not sure if they are equidistant for all the tunnels.
What are the precautions that one should be taking while using such a tunnel?
Obvious thing: A headlamp and/or a Flashlight is being carried along. Using the tunnel is not entirely legal, but that is not much of an issue either. Railway authorities know that people use the tunnels, but they have never taken an action since the terrain only allows that as a shortest possible way.