Let x be the speed of the slower train and x + 20 be the speed of the faster train.
We can use the formula d = rt to solve for the speed of each train.
540 mi = (x)(4.5 hr)
540 mi = (x + 20)(4.5 hr)
Solving for x, we get x = 40 mph and x + 20 = 60 mph.
Therefore, the slower train is traveling at 40 mph and the faster train is traveling at 60 mph.