Earlier quoted context omitted.
the courts have a right to strike down and nullify laws. And, at least theoretically, the military oath to defend the constitution could require them to overthrow a government which does not conform to the constitution. In practice, of course, issues are likely to be resolved before they reach that point.
It's also notable that there are many different militaries in the US: the 5 main national branches, the national guard units of the various states, as well as the state defense forces, that some states also maintain.
Good luck to the governor trying to muster the national guard to confront federal troops.