To find their speeds, you have to make them per hour instead of c hours.
You would divide each by their times, so
and

Train A's speed turns out to be 80 mph and Train B's is 88 mph
train B is faster.
Idk why you got it "wrong," I can't see your work, but I'm pretty sure this is how you'd do it :))