To figure this out you could use trial and error. I started with trying 60 mph for the freight train which means the passenger train would go 180 mph. This gave me too big of a difference (540-180 after they each travel three hours).
Then I tried 50 mph and 150 mph, and it was still too big(450-100).
When I did 40 mph it was 120 travel miles for the freight train, and 360 travel miles for the passenger train. This was the difference of 240 miles that was needed.
So the freight train traveled 40 mph and the passenger train traveled 120 mph.