Since the trains are moving towards each other, their relative speed is the sum of their speeds.
Relative speed
50+70=120 km/h
Convert to m/s:
120×36001000=33.33 m/s
Total distance to be covered
180+180=360 m
Time taken
Time=SpeedDistance=33.33360
Time=10.8 seconds
The trains will completely cross each other in 10.8 seconds