So, I'm at the battle of Whiterun and for some reason, I keep failing "Defend the Barricades". It seems almost impossible since I only have ~16-20 percent of the attackers defeated when the objective is failed.

It's been a LONG time since I played this quest (from either side....) - but.... seems I remember that I got the "failed" message too, but upon finding Balgruuf, he acted like it was completed. I dunno, go find him and see what happens?

During the fight, you have to be careful as rebels come from not only the front but also the sides to some extent. They can get by you and attack the drawbridge. When that goes down, you fail to defend the barricades. So, keep an eye on the walls behind you to kill the infiltrators.

So, I'm at the battle of Whiterun and for some reason, I keep failing "Defend the Barricades". It seems almost impossible since I only have ~16-20 percent of the attackers defeated when the objective is failed.

Don't worry about it; "Defend the Barricades" is just an objective; if you don't kill the 100% of stormcloaks you need to before the barricade is breached, the objective fails but then you get an objective to "Defend the drawbridge" etc. Basically you just keep falling back defensively until you've killed enough stormcloaks.

Incidentally, you can run out in front of the barricade & take them on close to where they spawn, somewhere near the stables. They'll usually go after you before trying to hit the barricade or the town, so you can keep the fight away from the city for the most part.