MANZO: But what else can we do? We can't find any samurai. We'll bargain all right, whether we like it or not.
The peasants' duty is a little different than the samurai's duty. The samurai are doing it for some higher ideal, but the farmers are doing it because it's literally a matter of life and death. "Duty" becomes "an obligation to survive" for them.
KAMBEI: This is the nature of war. By protecting others, you save yourselves.
Kambei cuts to the heart of duty here: in the end, you do best for yourself when you stand by someone else. If you won't do it because it's the right thing, do it because it will help you stay alive.
KAMBEI: The reward will only be three meals a day and the fun of it, if you want to put it that way.
"The fun of it" in this case may be a coy way of saying "because we're obligated." The question becomes whether they're obligated because the peasants need their help, or because it will help them feel like they once did when they were proper samurai.
LABOURER: They're giving you everything they have.
The peasants are sacrificing a lot to do this. If the samurai recognize that, then it basically obligates them to help. It's the duty of their class after all.
OLD WOMAN: I want to die.
As a counterpoint to the peasants' duty to live, we get some who openly demand to be killed. Kurosawa might be suggesting through them that the people of Japan are obligated to continue living in the face of their great defeat: to do their duty to their community and struggle on.
LABOURER: If you were sorry for them, really sorry, then you'd help them, wouldn't you?
We're cutting to the chase here. If the samurai cares about being a samurai, then he'll show mercy to the peasants and help. If not, then he's not really a samurai after all.
KAMBEI: As a matter of fact, I'm preparing for a tough war. It will bring us neither money nor fame. Want to join?
KAMBEI: Maybe we die this time.
Death, and more importantly an honorable death, was a big thing for a samurai. These two had failed in that duty, and they see the farmers' dilemma as a chance to make amends. In that sense, they fail at their duty a second time, which gives them a real sense of tragedy in the last scene.
GOROBEI: They can't be allowed to rejoin the others.
KYUZO: I'll get them. The hills are my responsibility.
Part of the allure of the samurai's position is that duty is defined for them so clearly. They don't need to question or wonder about other options. Kyuzo was assigned to watch the hills, so he's gotta go get the bandits there. End of discussion.
KAMBEI: There are only three houses beyond the bridge and there are twenty in
the village. We cannot endanger twenty because of three. And if the village is destroyed,
those three will not be safe anyway.
Duty here means figuring out what you can protect and what you can't. The sacrifice of those three homes means that the village as a whole will survive. Not everyone takes this lesson to heart, which might seem like a dereliction in their duty (more on that in a bit).
KAMBEI: You fool! Why did you leave your post?
Kambei is giving Kikuchiyo a ton of grief here, despite Kikuchiyo just scoring one of the bandits' rifles. In this case, duty means doing as you're told, rather than doing what you think is best.