Total distance travelled by the second train = (100+200)m=300m=0.3 km
Velocity of the first train = 120 km/h
Velocity of the second train = v km/h
So, relative velocity of the second train w.r.t. the first train
Now, we know that:-
Distance=Speed x Time
Thus, the velocity of the second train is 420 km/h if the trains are running in opposite direction, and 660 km/h if they are running in the same direction.