The idea of a militia defeating the US military would be silly unless the military themselves revolted, split, or the government lost control
Which is a distinct possibility. I remember when I was in, there was a pretty strong sentiment among soldiers that in the event we would have to choose between the government and the people, we'd choose the people. There is also still a lot of state loyalty among soldiers as well. So if a potential rebellion resulted from state secession like the last time, a lot of soldiers from the rebelling states would likely side with their state over the federal government.
Even without military support though, a rebellion does actually have a decent shot of inflicting enough casualties to force a government surrender. There are around 1.3 million total active duty military personnel in the US. There are an estimated 62.7 million gun owners in the US. So if just roughly 2% of all gun owners manage to get just a single kill shot on a soldier, that's the entire US military wiped out.