A 120 m long train is moving in a direction with speed 20 m/s. A train B moving with 30 m/s in the opposite direction and 130 m long crosses the first train in a time
Total disatance=130+120=250 m.
Relative velocity=30-(-20)=50m/s.
Hence t=25050=5 s