Given:
Initial Speed = u = 40 ms-1
Acceleration = a = - 2 ms-2 (Retardation, hence negative)
Final Speed = v
Now, s = Distance train travels before stopping
Now, we know from the equations of motion that,
v2 = u2 +2as
0 = 402 +2 \(\times\) (-2) \(\times\) s
4s = 1600
s = 400 m
So, the train covers 400 m before stopping.
Also, the length of platform = 400 m.
So, the train stops in time.