Let v1 = velocity of 1st train, v2 = velocity of the 2nd train = v1 - 17
Also, v1 = D1/t and v2 = D2/t where t = time = 4 hours and D = distance traveled
and D1 + D2 = 1212 km so, v1(t) + v2(t) = 1212 km
and v1(t) + (v1 - 17)(t) = 1212 substituting the time we have 4v1 + 4v1 - 68 = 1212
or 8v1 = 1280 Therefore, v1 = 160 km/hr
v2 = v1 - 17 = 160 - 17 = 143 km/hr