4kmph= 10/9 m/s
2kmph= 5/9 m/s
Let speed of train be s.
Relative speed × time = length of train
(s - 10/9) × 10= length
Also
(s - 5/9) × 9 = length
(s - 10/9) × 10 = (s - 5/9) × 9
s = 55/9
Length = (s - 10/9) × 10
= 50 metres
Ans: length of train is 50 metres