This is a fascinating question. I don't think this is a question of analyzing grammar, it's more of a question of how we understand real language in the real world. We understand it based on what we know about farms.
As you have written it, I would expect it to refer to both animals and vegetables.
It's not ambiguous. Here are two farms that do NOT have "many animals and vegetables:"
Farm A has thirty pigs, fifty sheep, forty cows, and six tomato plants in the farmhouse garden.
Farm B has two horses, twenty hectares of lettuce, twenty hectares of corn, and a twenty-hectare apple orchard.
If a farm has "many animals" I would expect that to mean that if you counted the animals, it would be a large number. But I would also expect there to be several different KINDS of animal, to justify using the word "animal" instead of using the name of the particular animal.
A farm that raises vegetables would always be a large number of individual plants, so I would expect "many vegetables" to mean "many different kinds of vegetable."
When talking to children who experience the farm almost like a zoo, I would say "animals." In a more formal, adult, or professional context, I would use the uncountable noun "livestock" instead of "animals," and "crops" instead of "vegetables."