I've looked at the API and I cannot find any way of triggering a train event from proximity to the player.
However - it would be possible to trigger a sound event when a train reserves a path through a signal.
So I could create a special signal entity which triggers a honk when the train reserves a path, and this could be placed strategically to warn players of an approaching train.