The farmers won. Why would they choose to farm if there were no advantages?
What happened was that farming was so successful that the human population boomed. When famine did occur, it caused more deaths because there were more humans.
Farming societies are more hierarchical and have more people. For the ones in charge that is for sure advantageous.
Also it’s a bit of a trap: as soon as you switch over you cannot go back, as foraging cannot sustain as many people. You will have to constantly expand to feed the growing population.
What happened was that farming was so successful that the human population boomed. When famine did occur, it caused more deaths because there were more humans.