Let x be the speed of the freight train, the slower train.
x + 14 is the speed of the faster train
t is the time it takes the freight train to go 330 miles and the time it takes the passenger train to go 400 mi, so
400 mi = (x+14)mi/h (t) hrs
and
330 mi = (x) mi/h (t) hrs
this system of simultaneous equations is easiest to solve by elimination, subtract the second equation from the first:
400mi - 330mi = (x+14)m/h (t) hrs - (x) m/h (t) hrs which can be rewritten by using the Distributive Law
70mi = [(x+14) - x] mi/h (t)hrs
70 mi = 14 mi/h (t) hrs,
t hrs = 70 mi ÷ 14 m/h = 5 hrs
Now that we know that t = 5 hours the speed of the passenger train is
400mi/5hrs = 80 mi/hr
the Freight train is 14 mi/h slower, or (80-14)mi/h = 66 mi/h
You can confirm the answer by multiplying the speed of the freight train by 5 hrs
(66 mi/h)(5h) = 330 mi which is the distance the freight train ravels in 5 hours.