I'll try it. I hope I do not make a stupid mistake.
When the first train has travelled one third of the distance separating it from the other train, the fly will have travelled two thirds of this distance, and the other train one third of the distance, in the opposite way, which means it is exactly the moment at which the fly hits the second train and turns back.
Let d be the initial distance between both trains. Now we are solving almost the same problem (the speeds do not change, and the way the fly travels is irrelevant, the problem is symmetric), the only parameter changing is the distance, now being 2/3 * d.
We can reason the same way ad infinitum and we identify the distance D travelled by the fly is the following:
D = 2/3 d + 2/3 (2/3 d) + ...
D = 2/3 d + (2/3)^2 d + (2/3)^3 d + ...
D = d * {sum for n from 1 to infinity}{(2/3) ^ n}
D = 3d
The fly travels 3 times the distance between the trains before dying.
The easier way is to notice that the trains will collide in 1h and the fly will be constantly be flying at a speed of 60mph for the entire time. So the fly will travel 60 miles in the alloted time.
When the first train has travelled one third of the distance separating it from the other train, the fly will have travelled two thirds of this distance, and the other train one third of the distance, in the opposite way, which means it is exactly the moment at which the fly hits the second train and turns back.
Let d be the initial distance between both trains. Now we are solving almost the same problem (the speeds do not change, and the way the fly travels is irrelevant, the problem is symmetric), the only parameter changing is the distance, now being 2/3 * d.
We can reason the same way ad infinitum and we identify the distance D travelled by the fly is the following:
D = 2/3 d + 2/3 (2/3 d) + ... D = 2/3 d + (2/3)^2 d + (2/3)^3 d + ... D = d * {sum for n from 1 to infinity}{(2/3) ^ n} D = 3d
The fly travels 3 times the distance between the trains before dying.