Militias refer to state militias. For example, in the civil war your state was your regiment. You would grab your rifle and meet up with your state. You were a Virginian or a New Yorker before you were American. These rules were set at the peak of states rights. It was not illegal for a state to have a strong defense.
It’s also weird to assume the military would follow the whims of a tyrannical federal government and start droning citizens. At most the military would split in a civil war but the US has an entirely volunteer military. They would be sooner to throw out a tyrant like Egypt than follow the ruling class into a spiral. They are sons, daughters and brothers not political robots.