1. In Nations where possession of firearms by non security forces is a capital crime, a criminal would resort to using knives to threaten lives, & thus the rifle carried by a bank security guard is more of a deterrence against the knife welding criminal, as that criminal would face a low chance of survival against bullets, more so from a trained security guard.
2. In the event of desperate criminals armed with rifles, the security guard would have to assess the situation carefully, & should he face bigger odds to save lives, he can surrender & drop his weapon, practice what he had been trained - to calm everyone down, seek for dialogue with the criminals to buy time, etc, etc...far better than running away & abandoning Human lives that he had sworn to protect....
He is not Rambo. Even if he decides to open fire upon the criminals, there may be inadvertent cross fire battle that may harm innocents, the very lives that he was paid to protect.
Furthermore, in banks, the security guard is more of a 1st level deterrence. Each bank cashier has a 2nd level security button under their counters that is directly linked to National security agencies whom would arrive in minutes to take control of the situation, far better than the security guard alone.
In the end, the critical question is - what had the private enterprise security agencies taught/trained to their security guard employees in the event of dire circumstances?