You could always jsut say that the villagers know how to build the fortifications but do not know how to fight and need training to fight. That could keep the group occupied adn let your villagers build the walls you want or have the villagers do it under the advice of the pcs. Do something to keep the PCs busy (like a scouting expedition that they had in the movie) and while they are gone the villagers are busy building away and you can make best judgement on how far the villagers got.
In my head, the villagers would be doing the work, but most likely under the direction of the pcs- because why accept responsibilities for defenses you didn't have any input in (and also, that's what the movie is like- the villagers do the work but under the direction of Kambei). The whole thing could be gridded out and the pcs get to chose x squares of wall, y squares of ditches, z squares of spiked logs, or whatever else they come up with per day. If there's not rules for that somewhere, I guess I could just make them up (with the idea that there are some limits to resources like time).
I had considered the training thing as well. Since they're halflings, I figured most would have their commoner proficiency with slings/stones/thrown weapons, but by training with the pcs could pick up a proficiency in another weapon (likely one that the town blacksmith could make enough of. In my head, short spears cause that's what the villagers in the movie used- but they might have other ideas). If they train them, I'd also considered having them each make a cha roll, and if it came up high enough their individual platoon would get an inspiration bonus whenever they were fighting within x feet of the PC (kind of like how some of the villagers were in awe of Kyūzō and some grew to respect Kikuchiyo).
They could also do some hit-and-run types of skirmish attacks against the bandits, to lead them on a wild goose chase and distract them. This would give them something to do, give the villagers time to work on the fortifications, and reduce the number of bandits they have to fight. As long as the PCs have a way to get away somehow (a ready boat in the river, etc), it could work.
Knowing some of the players. "Lets go get the bandits" will be something that comes up. I think it's smart as long as it doesn't get out of control/get them killed. I guess the biggest challenge is figuring out the number of bandits that will make it a defend the village adventure I'm aiming for (as opposed to "kick the dungeon door down and waste some monsters"- which is fun, but we do that a lot) while not overwhelming them and killing everyone's character. Any advice in that direction? I'm not really familiar with CR/ECL.
thanks for all the feedback so far.