I don't see any surrender. Even if the government is destroyed there will be a continued insurgency, especially in western and central Ukraine if the whole country fell or had a client government imposed.
Afghanistan? Russia would have another Afghanistan.
Has it been done before? Yes: UPA.
UPA operated from 1942 to 1950. Nazis occupying? Soviets? Didn't matter.
militaryhistorynow.com/2014/03/03/stuck-in-the-middle-the-forgotten-and-bloody-history-of-the-ukrainian-insurgent-army/
Was it a perfect organisation? Oh Lord no. But it keep going. Poles especially remember its truly darker side (and its actions are one of the reasons so many ethnic Ukrainians within Poland ended up being relocated to what had been southern East Prussia in post 1945 shift the borders westwards Communist Poland).
[Ukraine has just as much an intertwined back story with Poland as with Russia.]
If it exemplifies one thing it is the Ukrainians just not letting go and stoically standing your ground aspect of the culture.
So a decapitated and subdued Ukraine would have people fighting on but this time from urban areas and through cyber means as well as out in the forests.
But hopefully this does not come to pass. Ukraine is holding out well and the Russian forces are not performing as Putin assumed. How things will stand though is a week or so, I just do not know.