Hi Vic.
We have 2 trains, freight and express. We need to find the speed of each train, given their distance apart and the time it takes them to pass.
Recall
d = rt
Distance = rate times time
total d = 390 km
t = 3 hours
rf = rate (speed) of freight train
re = rate (speed) of express train
We also know, from the 2nd sentence
rf = re - 30
Putting this altogether,
d = rft + ret
390 = 3rf + 3re
and since rf = re-30
390 = 3(re-30) + 3re
Working with this equation we have
390 = 3re - 90 + 3re
390 = 6re - 90
480 = 6re
80 = re
And
rf = re-30 = 80-30 = 50
The express train is traveling 80 km/h and the freight train is traveling 50 km/h.