The length of train B is equal to the distance two train travelled in 6 seconds.
48x2=96
96km/h=80/3 m/s
The length of train B=6x80/3=160m