By arming pilots, you are putting a tool in their hands to stop a hijacking right now. It is the same safety level of prevention of putting an armed air Marshall on each flight. Both rely on a pistol to enforce the threat of force. Who would not feel safer flying with an armed pilot? A lot of pilots are ex-military as well. On 9-11, the hijackers were armed with knives, which are not effective against guns.
I can not even imagine how someone could possibly disagree with this. If an armed hijacker bursts into the cockpit demanding to seize the controls, only to be met with a shotgun in the mouth, yeah that gun is going to help. It would stop one hundred percent of plane crashe from hijackers.
I do not think it would help in the majority of cases. The cockpit of an airplane is the last place you want to have a gun battle. Pilots are strapped into tiny seats and so make a pretty good target for someone returning fire. I think the chance of a pilot being able to shoot a hijacker, without being hurt, or damaging the plane are pretty small.
No, I do not think that being armed would help a commercial airline pilot or their passengers in the event of a hijacking. Firing a gun in a pressurized steel tube hurtling through the air at hundreds of miles per hour is an astoundingly bad idea. Better to keep the cockpit door shielded from the cabin.