You can do it the ghetto way and predict where the player will be with velocity calculations, but using the train as the base for calculating motion instead of the player, similar to how anticheats work.. But, it is basically impossible to do.
If the player is moving, you could TECHNICALLY do...