I hereby support that a teacher is more important than a farmer
A teacher is one who teaches on how to rear animals farming livestock poultries etc
Without a teacher one could not know anything about agriculture or farming
Also a teacher is more better because he or she is one who teaches the society and future leaders
But a farmer can't teach the society
Just to establish some understanding, I assume by teacher you mean someone whose sole occupation is to teach other people (aka school teacher or professor) because farmers can teach other people how to farm, And therefore a farmer can be a teacher too using certain definitions.
Now that that's out of the way, Farmers are way more important than teachers because they provide the food people need to survive. While education is important in society, It is not as necessary as the farmer. After all, It was the transition from nomadic to agrarian society that ultimately lead to the civilization we live in today with all of the comforts and benefits it provides. Farmers tend to the stability of said civilization by providing people with food so others can focus on innovation.