As you have simplistically cast it, yes, a bunch of lightly-armed irregulars aren’t going to fare well against a professional mechanized force.
But even illiterate peasants know better than to try to go toe-to-toe in such a situation, thus guerrilla / insurgent / asymmetric campaigns could be waged. I gather it took the Iraqi/Afghan insurgents almost no time whatsoever to realize that they fared poorly on the 2-way range in stand up fights so they attacked supply lines, launched one-off mortar/rocket attacks on targets of opportunity, ambushed patrols, etc.
Occupying forces in Iraq and Afghanistan were also operating on remote battlefields somewhat of our choosing. Much of the logistics and pretty much all of the industrial base for the war was hundreds or thousands of miles away, typically with an ocean between it and the enemy. That would not be the case for some hypothetical domestic oppressive regime operating in the US. Military bases might be called forts, but as the Fort Hood incident showed, they’re hardly the hardened fortifications the title suggests. That’s to say nothing of the sprawling infrastructure of the modern economy, itself only hardened to the extent that it keeps the honest people out under fear of arrest.
Besides … modern economies are worth far more left operating as-is and interacted with via trade than warfare or occupation which can set them back a generation or more in a few short years.
For all the armchair sneering at the AR-15 design and 5.56x45, you’re arguing against a large volume of history insofar as its effectiveness as an infantry arm.
Insofar as “massacring children”, rifles - of which the AR-15 is a subset - are a relative drop in the bucket relative to handguns, knives, the human body itself, and blunt objects.