I don't think either Yahoo or Twitter has to lose money, but the path to profitability is a horrible one: they're both heavily overstaffed for what they do. Twitter in particular, IIRC, has thousands of employees, managing what's actually a fairly simple product. You could reduce the headcount to well under a hundred people.
In that respect, being bought out is a preferable solution. The newly created division can set about reorganizing itself as a small focused team on the product at hand, while much of the remaining staff can be absorbed into the larger company over time. There'd still be redundancies, but they wouldn't be anything like as bad.