There are two trains. The first train is travelling at 52 km/h. The second train is travelling at 68 km/h. It takes 9 seconds for the second train to pass the first train. How long is the second train?

in 9 seconds

1st train went 52000(9/3600) or 130 m
2nd train went 68000(9/3600) or 170 m
they were in the act of passing 40 m, the length of the train.

or

the second train is gaining at 68-52 or 16 km/h
distance covered at that speed = 16000(9/3600) = 0 m