School lunch isn't the problem. Not even the good days, the days with food that full of enough grease and protein even the broken souls in the kitchen couldn't fuck enough to make it inedible, wasn't going to set you back more than a big mac calorie wise.
Now, I'm not going say that if you're already a fatty fat the average school lunch was going to necessarily HELP this issue, but school lunch didn't make you a tubb-o.
@Pokemonquistador also addresses the primary issue, which is fresh fruit/veggies are a loving nightmare at industrial scale. Our school was far from the worst, but they could barely manage to give us decent canned stuff, I can only image the wilted and browned results of them trying to source fresh ingredients.
You've figured out part of the problem, which is that there's no more recess, gym is a joke, and everyone goes home to park their ass in front of
WoW LoL Fortnite APeX Legends; no one goes out to ride bikes after school anymore because its dangerous and boring, while stuffing their faces.
School lunch was generally weighted towards caloric intake because it was set up to ensure the poor students had at least one decent meal. This was of course a goal set in the 60s/70s, where getting enough calories was a challenge, versus today where the average homeless kid looks like this:
In the wake of a national college admission scandal, a Jersey City teen has fought through homelessness to have a bright educational future.
www.northjersey.com
That brave student beat the odds, Homelessness, AND anorexia.