Once you detect that electricity supply is damaged and that it’s over 10 miles and you know how many trains have stopped moving … you know it won’t be 10 minutes. It can’t take long to figure out what trains have stopped moving and where electricity has been cut.
And at the 4 hour mark, the passengers were rescued. It would be ironic, of course, if the rescue train hit any one of the geniuses that smashed windows and started walking the tracks.