Anyone attempting to hijack a flight full of Americans is going to be attacked every single time, and terrorists surely know this, and that's the real deterrent. Hijackers might think they can overpower a single armed officer but they know they can't overpower dozens of passengers that feel forced to fight or die.
It might even be a good idea for pre-flight training videos to explicitly tell passengers to immediately attack anyone attempting to hijack the plane. Though this is probably unnecessary, it could act as a strong additional deterrent and help coordinate people in the event.