"Martial law" is not a cleanly-defined legal concept in US law, but it is generally understood to refer to placing a region of the US under military control. POTUS, Congress and state governors can do it, to some extent. Art. 1, §9 (speaking of powers denied to Congress) says that "The Privilege of the Writ of Habeas Corpus shall not be suspended, unless when in Cases of Rebellion or Invasion the public Safety may require it". Suspending the Writ of Habeas Corpus is one fundamental element of "martial law". Art. 2 §2 (presidential powers) grants relatively little power to POTUS, but does say "The President shall be Commander in Chief of the Army and Navy of the United States, and of the Militia of the several States, when called into the actual Service of the United States", so as commander in chief, POTUS can command the army, but in general requires authorization from Congress.
At the outset of the Civil War, Lincoln declared a numbered of things which Congress ratified, but this did not include a declaration of martial law. In Ex parte Merryman, 17 F. Cas. 144, the Taney (Chief Justice of the Supreme Court of the United States) stated that "the president, under the constitution of the United States, cannot suspend the privilege of the writ of habeas corpus, nor authorize a military officer to do it". Congress eventually retroactively legalized the suspension of habeas corpus. Without Congressional approval of the suspension of the Writ of Habeas Corpus, a "declaration of martial law" would be meaningless and toothless.
The Posse Comitatus Act further limits the ability of the army to meddle in domestic affair, and 18 USC 1385 states that
Whoever, except in cases and under circumstances expressly authorized
by the Constitution or Act of Congress, willfully uses any part of the
Army or the Air Force as a posse comitatus or otherwise to execute the
laws shall be fined under this title or imprisoned not more than two
years, or both.
One of authorizations by Congess is The Enforcement Acts, which empowered federal intervention when states refused to protect the constitutional rights of citizens, and this was invoked more recently during the Eisenhower administration and in connection with the Mississippi Burning murders. Another much older authorization is the Insurrection Act of 1807, now at 10 USC Ch. 13 allows use of the military (§252):
Whenever the President considers that unlawful obstructions,
combinations, or assemblages, or rebellion against the authority of
the United States, make it impracticable to enforce the laws of the
United States in any State by the ordinary course of judicial
proceedings, he may call into Federal service such of the militia of
any State, and use such of the armed forces, as he considers necessary
to enforce those laws or to suppress the rebellion.
The next section §253 would, no doubt, be the statutory provision invoked for use of the military:
The President, by using the militia or the armed forces, or both, or
by any other means, shall take such measures as he considers necessary
to suppress, in a State, any insurrection, domestic violence, unlawful
combination, or conspiracy, if it—
(1) so hinders the execution of the laws of that State, and of the
United States within the State, that any part or class of its people
is deprived of a right, privilege, immunity, or protection named in
the Constitution and secured by law, and the constituted authorities
of that State are unable, fail, or refuse to protect that right,
privilege, or immunity, or to give that protection; or
(2) opposes or obstructs the execution of the laws of the United
States or impedes the course of justice under those laws.
In any situation covered by clause (1), the State shall be considered
to have denied the equal protection of the laws secured by the
Constitution.
The rhetoric that would need to be associated with such an executive order (sending in the troops) would resemble that in Texas v. Pennsylvania et al, which did not turn out well for POTUS. Moreover, nothing at all authorizes POTUS to declare elections void and to order new elections (therefore, the military cannot be employed to engage in such an illegal action).