A train was running on the railway, with its headlights on and a warning that it was about to arrive.