^ Most of the birds I see do move away but tend to leave it very late to do so and they don't always fly.
A flock of Pink-footed Geese in a field yesterday just waddled away across the field.
There was a bit of a comedy moment involving a Moorhen which was crossing the somewhat complex high speed section just south of Wigan on foot. Caught in between the rails of the line I was approaching on, it decided that walking was the best way of escaping. First it went right, back the way it had come, then left, then right again, then finally left and just managed to hop over the rail in time as my train went past at 95mph.
Flying raptors often leave it very late to take avoiding action and frequently fly across right in front of an approaching train.
Sometimes birds are spooked by a passing train one day, then the next they show no reaction at all at the same location. This often happens with flocks of Eurasian Wigeon where my core route crosses the River Leven estuary on a long viaduct.
I suspect birds don't see trains as a threat until they are very close which is probably partly due to the way birds perceive the world visually and partly due to them not having any evolutionary reason to view such recent intruders into their world as a threat. For birds standing on the rails, something that owls like to do rather a lot, an approaching train may not appear to be moving at all even though in reality it may be approaching at 100mph or more. Even if they are aware that it is moving, they have no evolutionary reason to believe it will continue to follow the same path.
Most birds seem to be largely unbothered by stationary or slow moving trains. Feral pigeons are happy to get on board to look for food as often happens at Blackpool North. Small passerines pick dead insects from the front of stationary trains at many locations in summer. In many areas sidings offer good nesting sites for some species even where the sidings are still in use. My own depot has Eurasian Oystercatches, and Herring and Lesser Black-backed Gulls nesting on the track. Mallards often nest very close to the track, just tucked inside a little bit of lineside vegetation. Common Shelducks nest successfully in old rabbit burrows in railway embankments, which must be "interesting" when a heavy freight train passes above.