Emergency crews said a train engineer and another crew member were taken to nearby hospitals with injuries that were believed to be minor.
Helicopter video taken from over the derailment scene showed the smoky locomotives being doused with fire extinguishing foam. One was laying on its side, while the other remained upright.
Allegheny County Emergency Services Chief Alvin Henderson said one train was stopped or going very slowly when it was rear-ended by a second train about 2 p.m.. The second train had three engines, two of which derailed and their fuel tanks caught fire.
The derailed tank cars were empty, but they had residual ethanol inside, Pennsylvania Emergency Management Agency spokesman Cory Angell said.
That prompted evacuations of nearby businesses and homes because ethanol residue can be dangerous in a fiery situation, Angell said.