There’s a reason you separate military and the police. One fights the enemies of the state. The other serves and protects the people. When the military becomes both, then the enemies of the state tend to become the people.
From Adama in Battlestar Galactica
Agreed. The important difference here is that in these cases they do not serve in their form as a (military) force. They have no more authority in these situations than a random citizen already performing said tasks. Performing policing duties, they inherently have power and authority.