Neither NPCs nor cinematic sequences need to follow the rules, so don't bother trying to balance something like this
Combat being balanced mostly means, in this case, that it will be longer. Having four hours of combat, where there are no stakes because the outcome doesn't matter to the story and players are sitting idle ~90% of the time while you roll dice, may not have the effect you want.
I have a couple of reasons why I think that this idea suits the situation you describe:
1. Combat is slow, and the game is intended to be played by players, not NPCs
Combat is generally the most time-consuming piece of play in D&D; it takes time for everyone to consider their options, make choices, roll dice, and so on. It can already be a problem for players who are awaiting their turns with a small party. Adding in 10-30 additional individuals will slow things down to an outrageous degree, and there will be literally nothing for the players to do (or even really think about, at level 1) for ~90% of combat time (just by numbers of characters on the field).
And what you get for all that trouble isn't much: a fight your players mostly watch unfold, but which probably doesn't have much impact outside of the things your players do get to do (if the forces are intended to be evenly matched without the PCs, then this is mechanically the same as a decisive fight involving the PCs alone against a challenge meant to be balanced for them).
2. Commoners aren't going to be very interesting in combat as combatants
Throwing in an NPC who is not very capable in combat works here and there: an escort mission, a rescue, and other things like that can make commoners interesting by influencing the decisions PCs make in a fight by adding extra constraints.
But a commoner rolling to hit with an unarmed strike, improvised weapon, or simple weapon over and over again is going to get repetitive quickly. They don't have any special powers or combat maneuvers, nor any special relevance to the battle. They just exist until they are downed. While they are still in fighting shape, they will inevitably surround the bandits, secure flanking bonuses to attack with Advantage, and are likely to cripple the other side, if not win outright, through weight of numbers.
Either way, my experience suggests that this is likely to come down to slow grinding down of each side, which will cause any sense of danger and tension to bleed away long before the fight is over.
What to do instead? It depends on your goals
When considering any scene in a game, it's important to consider what you want the point of that scene to be. Then you shape other things to suit that goal. For my DM style, sequences like this are virtually always one of two things:
- A cinematic spectacle establishing mood and tone
- An environmental obstacle
A cinematic spectacle doesn't need any rules at all, nor any variability. A vicious bandit can hack a poor villager to pieces just when they come into a PC's view, or a group of five villagers might force a bandit to the ground and then hack him or her to death with their farm tools. You can emphasize how unprepared the villager is compared to the bandit, how violent and callous the criminals are, and so on. These are staged in advance and don't vary because they are strictly narrative devices which just happen to take place in a combat environment. You choose when the players receive any bit of narration, but there isn't any meaningful, rules-based combat happening around them.
As an environmental obstacle the brawl around the PCs imposes additional constraints on combat (even if the players define those for themselves) and presents unpredictable dangers and opportunities. If the PCs want to protect the villagers they will have to keep an eye out for villagers in immediate danger and then try to intervene. If it's a big brawl I wouldn't expect the villagers or bandits to know whose side the PCs are on-- do random NPCs stab out at the PCs, or suddenly attack someone endangering the PCs? Who knows? That kind of thing being decided by dice roll each round or PC turn can ratchet up tension and make the combat more interesting.
There is some official guidance for this, which treats groups of individuals as mobs with probabilities of landing at least one hit
There is an approach in the DMG for large scale combat involving mobs of individual creatures:
Keeping combat moving along at a brisk pace can be difficult when there are dozens of monsters involved in a battle. When handling a crowded battlefield, you can speed up play by forgoing attack rolls in favor of approximating the average number of hits a large group of monsters can inflict on a target.
Instead of rolling an attack roll, determine the minimum d20 roll a creature needs in order to hit a target by subtracting its attack bonus from the target’s AC. You’ll need to refer to the result throughout the battle, so it’s best to write it down. [Full rules follow, but it seems too much to reproduce the whole section here] (DMG, Chapter 8: Running the Game, Combat, Mob Attacks).
I've used these and they will definitely streamline combat with lots of participants for you, as well as making balance considerations easier. I, personally, have not found large-scale combats using these rules to be all that exciting for the players (unless they have their own, more conventional combat goals to consider), but the option exists and will help with your goal here. It is relatively easy to game out combat when hits are guaranteed each turn. You just need to decide on sizes for the mobs.