WW1 trench warfare was dominated by artillery, which caused the majority of casualties, more than machine guns, rifles and disease combined. That is why casualty rates favored the attacker - they were sweeping up the suppressed remains after an overwhelming artillery barrage.
The same applies in modern warzones, what works as a defensive position against a gun-armed mob doesn't necessarily work against infantry with military weapons including mortars and grenade launchers, and vice versa - if you know your opponents don't have proper equipment, you can effectively make deadly defensive positions which modern militaries wouldn't be able to use against their opponents.
Artillery and mortars where hardly limited to attacking or defending. Sweeping up after an overwhelming artillery barrage presupposes the attackers having artillery supremacy. In a true stalemate both sides just get hammered by artillery with neither receiving a net advantage while both rack up casualties.
As to a gun armed mob, it really depends on how capable they are. A defensive position is of limited value vs a well trained sniper using even a simple hunting rifle. The basic issue is it’s difficult to actually defend yourself without also exposing yourself. This is further degraded when talking about a single defender who can’t benefit from overlapping fields of fire etc.
Our hypothetical survivalist would benefit from training, but they don’t receive the primary benefit that keeps modern military casualties low, access to trained and well supplied medical personnel.
Analysts of actual WWI battles by experts. Don’t get me wrong early in the war attacking in daylight over no man’s land was ruinous, but tactics evolved and eventually favored the attack and counter attack.
Not that post apocalyptic battles will involve artillery and tanks, but it is still informative.