Let's say that the speed of the freight train is [tex]x[/tex] and the one of the passenger train is [tex]3x[/tex].
[tex]x[/tex] MPH means every hour the freight train covers [tex]x[/tex] miles., which means in 3h it will have covered 3 times as much: [tex]3x[/tex] mi.
Following the same logic, [tex]3x[/tex] MPH means every hour the passenger train covers [tex]3x[/tex] miles, meaning after 3h it will have covered 3 times as much as well: [tex]9x[/tex] mi.
Now, having expressed those distances and speeds algebraically, we find the difference between the two distances covered after 3h, knowing it will be equal to 240:
[tex]9x-3x=6x\\6x=240\\x=240/6\\x=40[/tex]
Knowing this, we can surely affirm that the freight train is travelling at 40MPH and the passenger train is travelling three times as fast, 120MPH.