Cows and sheep would die horrible, slow, painful deaths if immediately released from human-supervised husbandry. This is because they've been bred to overproduce, and without someone else around to remove the excess milk/wool, they will keep on producing and destroy their own bodies.
Chickens are surprisingly robust even in their ultra-refined genetic state. It really just comes down to what kind of predators are involved, but chickens will happily take to the wilderness and never look back. Hawaii has a very large population of wild chickens, thanks to a lack of particularly threatening natural predators (aside from tourists, that plague known as the multicolored death!). Goats are also reasonably capable of taking care of themselves, but dairy goats can run into the same sort of problems as cows.
Pigs don't really give a shit, and will gleefully go feral and eat everything.
Yes, industrial farming practices are awful for everyone involved, often in wide-reaching ways. I do feel it's possible for farming to, with different methods, provide a full, comfortable life for the animals. And as for whether or not it's ethical to (painlessly) kill and eat them afterwards, I suppose that depends a fair deal on how sacred you feel life is. Stuff like production of wool, eggs, and milk (and cheese, when not using rennet or just using non-animal rennet) is a bit less ethically loaded in my opinion, as you're not ending something's individual existence (and thus its potential capacity to experience further happiness) in order to get the product.
As has been touched on earlier, we are an exploitative species, and there's not much of any way around that except by spontaneously developing photosynthesis, and we'd probably find a way of making that exploitative too. All we can do is try to exploit other animals, plants, and land as nicely as possible.
I mean, hell, even yeast is technically a living organism...