They weren't permitted to carry their weapons with them. In the case of the recruitment center shootings, the recruiters weren't allowed to carry either.
One MPO confronted him with a gun, shot and missed. Then he took his own life.
So not even the military trained are guaranteed to put a shooter down.
Yeah, it was a bum example though. Sorry.