The F-22 is an air dominance fighter, taken off on runways, no anti ground capabilities, but undeniably a good fighter jet.
However, the F-35 is a multirole fighter with more endurance. It can fight in the air AND ground, it is VTOL capable, carrier capable, and OVERALL a better fighter, the F-22 takes the air...
The F-35 takes the war.