The doppler effect plays a key role in this example since an object produces different kinds of sounds depending on the distance and speed it is moving.
Here the associative prediction used by Sanjay helping him to know that the train was approaching.
The reasons to know and identify the different sounds of the train resides in the fact of plenty of times Sanjay had been in the train station, he is familiar with the zone environment, and different sounds and movements were saved in his subconscious.
So having these previous experiences, allowed him to predict accurately if the train was approaching in a fast way, due to the sound it was emitting.