Well I should point out the US wasn't trying to "win" in Afghanistan or Iraq. Those were military industrial complex driven wars. It was about money. The longer the war went on, the more money arms manufacturers made. The actual combat, the actual "war" part was just the bread and circus for the media.
And the Russian military isn't the second strongest in the world. They claimed it was. On paper it was. And it turns out it was a Potemkin army. They didn't have the weapons they claimed. They didn't have the training. The don't have the top of the line tanks and armored cars. It was all fake. That's why they're using mosin rifles and basic civilian cars with machine guns bolted on top.
Also the Ukraine forces are being massively backed up by on the ground US forces. The "volunteers" who managed to form entire companies with organizations, staff and supplies.
And yes, the US military, actually trying to put down a rebellion, would 100% beat a bunch of rural farmers with long guns. With actual tanks. And planes and drones and ships and missiles and helicopters and smart bombs. Because here's the thing about rural Americans - they over estimate how badass they are, and how much they can take. US towns are small. A few bombs takes out the entire town center, another the gas station, a fourth the Walmart, and a fifth the local Church. That's it. That's the town gone, and the nearest other is 20miles away, and despite how badass they claim to be, they're not going live in the woods in blown out buildings surviving off of twigs and bugs. They want the modern comforts, like showers, and gas, and refrigerated food.
And that's assuming the government doesn't just shut down the water and power grids and just wait. Rural redneck rebels will get the message really quick.