So what is the trolley problem? People who are starving don't buy meat.
The problem is that factory farmed animals usually eat grain which could be used to feed humans. Even if only 10% of their feed is suitable for human consumption, it's still a net loss of food, because meat is an extremely inefficient source of calories.