first, convert all the km/hr into m/s
You will get that
initial speed = 20 m/s
Initial speed of Green train = 40 m/s
Initial separation = 950 m
Velocity of approach = 20 - -40 = 60 m/s
relative acceleration = -4 m/s^2
v = u + at
0 = 60 - 4t
t = 15s
s = ut + 1/2 at t
s = 60 15 - 1/2 4 * 225
s = 900 - 450
Separation when they stop = 450 m
hope this helps