I can't imagine Georgia and Ukraine successfully defending against Russia without foreign aid. They are extremely weak economically and militarily, their armies are much smaller and badly equipped, have far fewer resources and population.
Georgia overran South Ossetia in the opening stage of the war of 2008 and then was driven out by Russians. If, say, the US and neighboring countries (especially Turkey) supported Georgia with weapons and mercenaries (like in Afghanistan), then it could have held off Russia in the mountains for long enough for the international community to intervene and establish ceasefire line on the Caucasus mountains, eliminating South Ossetian de-facto control of Georgian territories or at least reduce the size of it. This is how Georgia could theoretically win.
Same goes for Ukraine, but it's all much easier as Russia isn't officially at war with them and all it can do is support separatists with weapons and mercenaries. Ukraine is also bigger and more populous than Georgia. The US could easily win a proxy war with Russia in Georgia and Ukraine if it dared.