As a kid, I did have the choice but I didn't have the knowledge. Had I been informed about how harmful sugar is, I would have just chosen to drink water, at least after I turned 5 years old and had a concept of long-term health consequences being linked to some behaviors.
In the US, schools tend to be pretty good at this these days. Possibly in part because in 2010 there was the "Healthy Hunger-Free Kids Act". Part of this outlined acceptable beverages, and the guidelines exclude anything with added sugar. But if parents aren't reinforcing that, or in fact go against it in what is allowed at home, that won't help too much.
Although somewhat to my frustration, schools (at least in my district) have taken what I consider unreasonable initiative in further limitations of food that parents can send to school. My daughter came home upset one day, thinking she had done something bad, when I packed a piece of chocolate in her lunch for a special occasion. It was seen by staff and she was scolded for it. Apart from what I view an overreach, if there was a problem then the school should have taken it up with me, the parent, and not done anything in a way that made my daughter feel the she was to blame.
Edit: I love twin studies for exploring this sort of nature/nurture issue. Here's one for executive function that looks at both identical & fraternal twins, and their conclusion is a heavy genetic influence: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2762790/