let's say v_1 is speed of freight train, v_2 is speed of the passenger train v_2= 12+v_1 , time is "t" for the both trains is the same and you have distance of freight train s_1= 230 and distance of the passenger train s_2= 290

does this help you ?

show what have you done