A federal appeals court on Tuesday upheld a finding by the Environmental Protection Agency that heat-trapping gases from industry and vehicles endanger public health, dealing a decisive blow to companies and states that had sued to block agency rules. “This is a slam-dunk victory for E.P.A. and for the Clean Air Act,” said Frank O’Donnell, the president of the group Clean Air Watch.