> I don't know what the solution to this is.
The problems you mention are very real. I am not in farming, so a noob, but it is clear to me that significant change in food production is a requirement.
I see some positive trends (at least here in The Netherlands). On the one hand the awareness that industrial-scale production is unsustainable. There is a Guardian article on that today: 'Europe's meat and dairy production must halve by 2050, expert warns' [0]. Also there was talk on potato farmers getting only 0.09ct per kilo for their produce, while in the supermarket it costs $1.80 (this for local production, NL is quite small). Even large farmers are selling below cost price. Furthermore they throw small potatoes back on the field to rot, because they do not match supermarket criteria. Etcetera. NL is 2nd-largest food exporter (in a bunch of markets) in the world, after US [1]. A system under strain.
On the other hand - at the consumer side - there is growing awareness of the problem, more willingness to pay more for local and organically (eco) grown foodstuffs.
I think it should be possible for different models to be profitable. Besides the bartering communities mentioned by sibling, your small farmers could all arrange yourselves in co-ops, both to the supply-side (buy machinery together) as towards consumer-side (e.g. run/finance a co-op supermarket).
Regarding produce: Diversifying, and offering stuff that is not in supermarket can be a unique selling point. Good cooking with proper ingredients has become a hype in NL (stimulated by countless TV programs). Now take cucumber. The supermarket only has the long green, rather tasteless kind. But there are countless varieties. Different forms, different flavors, more tasty. Sell it as a specialty. Tell a good story with them (i.e. marketing storytelling), 'The good country life'-idea. Have people be willing to pay a premium.
I realize that in Netherlands this may be easier, because of population density, and production being always very near to consumers.
[0] https://www.theguardian.com/environment/2018/sep/15/europe-m...
[1] https://www.nationalgeographic.com/magazine/2017/09/holland-...