Locomotives on a Norfolk Southern freight train have derailed near Pittsburgh, catching fire and prompting the precautionary evacuation of nearby residents.