You could use a system of IR leds and receivers placed an inch or so apart that are set to detect the train and measure the time between blocking the first sensor to the second. Then use the formula d/t=s, where t is time, d is distance and s is speed. Then if you know the distance to the next station it can be accurately calculated based on the initial speed recording. This is only accurate if the speed doesn’t change from point a to b. Now if you want this to be more accurate you can use station 2 as the reference to station 3 and recalculate (maybe making the new distance a foot or so away) and so on down the line. This will cause the arrival estimates to change and adapt according to changes in train speed. This type of system was used by real railroads up to the use of GPS to relay speed and location data back to the CTC.