Read first: I somehow forgot the limitation to consider farm animals, therefore the following answer is partially off topic, but since it's already written I'll keep it here.
farm animals worldwide realise in 2018 that they have an intelligence
equivalent to the human one
Do they also have our knowledge?
If they have it there's no reason why they can't run our business and production facilities as we do, they will use the same control techniques that we use and they can use our own weapons against us. They would perform better than us since they are a gigantic number and they have completely different shapes and abilities, we are more or less a bunch of clones compared to them. A bunch of clones that speak numbers of different languages, because of no reason, since every animal can use the "common language" and the "clones" are animals too. Literally. They would be everywhere, in huge number, with notable communication capabilities, with an exceptional set of skills, and they can reproduce way faster than us.
If they gain intelligence and spend some time to prepare the strike in advance, we're totally screwed.
If they don't have our knowledge, we are still in danger: unluckily we can't just kill/control every animal, we need them to sustain our habitat, and at the opposite they have the best outcome with a human extinction.
Since intelligence without knowledge is a nonsense, i assume that they have the knowledge of a 5 year old human kid plus their habitat knowledge (for instance, a poisonous snake really knows how much heavyweight can reasonably attack/cripple with its own poison).
With these skills and some time (1 month?) to prepare the attack the possibilities are endless:
- wild animals can plan to free most part of caged ones on the first day of the strike, this will hurt our food income by a lot
- fishes won't be anymore such a dumb beings that can be "harvested" by large nets
- beavers can block our aqueducts
- rodents can cripple our electric distribution
- rabbits can degrade our streets far from the cities, digging underground holes, slowing down our travel capability
- the same with our railway network
- birds can transport to and deliver inside heavily populated and defended buildings some invective insects (malaria, zika, plague, dengue...)
- apex predators can patrol the fields to avoid non-well-armed humans to resupply vegetables and/or water
- big animals can easily build barricades
Common animal traps can work once, since they are intelligent beings they will learn quickly.
Military bases and navy fleets can't be directly attacked, but they will be confined and sooner or later they will collapse. A frontal fight with a military convoy won't be feasible but the every military force needs some support from the non military people: wars are usually lost due to lack of resources, not to lack of soldiers.
Considering that they don't have a lot of knowledge at the beginning but they will learn, and only their sheer number, humans will be overwhelmed within a couple of year at maximum. Our former "food" is not only not available but also fighting against us, and it's way more adapted than us to live in a post apocalyptic world.
We could (re)capture some cows, chickens, fish, etc and try to use hydroponics to pump some vegetables on the market, but it will be difficult to sustain this for more than a hundred (well defended) people.
One last note, I didn't analyze the hypothesis of animals that will let us alive (except for few specimens in a reverse zoo) because they are supposed to be intelligent and an intelligent beings won't let us continue to do what we are doing.