I forget where that data is located (if anyone has a link then please post it), but if I remember correctly, every single Manhattan crosstown route and certain major north-south routes (M15, M101, might be others) turn a profit. The rest of the routes are there for coverage and to serve those with disabilities who can't access the non-ADA compliant stations.
The thing is that those local buses, for the most part, have significantly higher ridership compared to express buses. Local buses you can get on or off anyone along the route, but once you get on an express bus you can't get off until you leave the borough. Besides for the few outliers, the most unused local buses cost less to operate than the most used express buses.
Riders per express bus
Riders per local bus (doesn't have all local buses)