Their jobs shouldn't be to ever engage armed robbers in shootouts in public places. One of the things I've heard talked about regarding proper police behavior is "time distance, cover". By giving yourself distance, you give yourself time, and cover. This allows you to deal with a situation far more safely.
The North Hollywood shooter, as far as I can tell, is what has driven this militarization of the police in America. The Cops lost their shit because they decided to get into a shootout with dudes with assault rifles and body armor. What they should have done, was just followed them at a safe distance until the appropriate units could be dispatched. Instead, they opted to get into a gun fight with their service pistols, until they could break out bigger guns.
Obviously exceptions would be made for areas or locales where there are no specialized units, but the reality is pretty simple. Unless someone is literally about to be murdered, the cops don't need to engage directly, and they can certainly follow at a safe, less confrontational distance until the suspects run out of gas, or otherwise stop in a less congested area.
Arming cops to the teeth, gives too many of them the idea that they are some highly trained operators, and emboldens them to do shit like we just saw. Hose a UPS truck down, kill 2 bad guys, but also pump the UPs driver full of lead, oh, and kill another innocent 100 yards away from the truck or so. The worst part is, in the heat of that moment, that UPS driver was deliberately shot, as he was mistaken for a hostile. You know what would have saved the UPS driver? Time, distance, cover.