Let length of each train be x meters
Relative motion of the faster train w.r.t. slower train is difference of their speeds,
i.e., 10 km per hour.
Hence two trains will be clear of each other in 36 seconds which is the time taken in moving the distance of 2x metres @ 10 km/hr.= 10×518
we know that,
distance=speed×time
⇒2x=10×5×3618
⇒x=50
∴ Length of each train =50m