Answer: Person B
Step-by-step explanation:
Well, let's begin by explaining the Doppler effect, in order to understand better this situation:
Doppler Effect consists in the change in a wave (sound wave here) perceived frequency when the emitter of the waves, and the receiver move relative to each other.
That is: It is the variation of the frequency of the sound wave due to the relative movement of the source of the sound wave with respect to its receiver.
For example, if we see the figure attached, as this train (the source of the sound) moves to the right (closer to receiver B), the frequency is increased; but as the source of the sound moves away from the receiver B, the frequency is lowered.
Now, having this clear we have to understand that the pitch of a sound has a close relation with the frequency, hence if the frequency is high, the pitch is high as well.
This means that, as the train moves to the right, in the direction where Person B is, Person B will hear the train horn at a higher pitch than Person A.