While it is not perfect if running on 30' rails the number of rail lengths traveled in 20.5 seconds is the speed in MPH.
If running on 39' rails the number of rail lengths traveled in 26.6 second is the speed in MPH.
This is a simple way of getting a good estimate of speed without having to time a mile and do the math and wonder if the mile posts are actually a mile apart. All you need is a watch with a sweep second hand and the ability to count the joints on one rail.
In my experience the railroads have pretty much standard rail lengths ie: all one length whatever it is, not a mix of different lengths.
John Bush