Chickens are also often kept in tiny cages, often mutilated. Cows are too, sometimes, but on average I think cows spend more time outside than most other farm animals. Though this varies wildly of course.
Sadly, growing cattle costs enormous amounts of food that could also feed people. And they seem to contribute quite a bit to greenhouse gasses. So eating beef may be better than eating chicken when it comes to animal welfare, but worse when it comes to the environment.
Best just eat less meat in general.