That statement assumes that the government orders the military to fight against the coup. The commander in chief would not order it, and had the coup succeeded, the Congress would certify that the commander should continue in power.
At that point it would require the top generals to stage a coup of their own. Which they probably would have. But I'm glad we didn't find out.
The military is extremely strong and would easily show off foreign invaders. But the Constitution didn't foresee an elected but corrupt executive overthrowing the government. That is a blind spot they reasonably didn't anticipate.