At worst, all the farmers will relentlessly fight to the death, in that case the bandits get one year of food and have to figure something else out next year.
That outcome strictly dominates not stealing any food this year, and needing to figure out something else out both this year and next year.
Bandits have obvious cost: if they kill all farmers, from whom are they going to take stuff?
That’s not a cost.
At worst, all the farmers will relentlessly fight to the death, in that case the bandits get one year of food and have to figure something else out next year.
That outcome strictly dominates not stealing any food this year, and needing to figure out something else out both this year and next year.