This is because the relative velocity of the train in which the person is sitting with respect to the other train is zero.
For example,
The velocity of 'A' train = 50 km/hr. due East and the velocity of 'B' train = 50 km/hr. due East.
Relative velocity of A train w.r.t., B train = 50 - 50 = 0.
And similarly Relative velocity of B w.r.t., A = 0.