Explanation:
Given that,
Frequency of train horn, f = 218 Hz
Speed of train, 
The speed of sound, V = 344 m/s (say)
The speed of the observed person, 
(a) When the train approaches you, the Doppler's effect gives the frequency as follows :

(b) When the train moves away from you, the Doppler's effect gives the frequency as follows :

Hence, this is the required solution.