Advocates are trying to get rid of sodas and snacks, replacing them with healthier foods.

The arguments over serving junk food in schools is not about just calories and trans fats.

It is also about money.

Policies to keep junk food from competing with school meal plans appeared to curb childhood obesity, but students who lived in wealthier neighborhoods have shown more progress than those from low-income areas, according to a study of California children.

“The magnitude of improvements depended on levels of school neighborhood socioeconomic advantage,” the study authors wrote in 2015 for the journal JAMA Pediatrics.

Co-author Emma V. Sanchez-Vaznaugh, Sc.D., M.P.H., of San Francisco State University, said the research team analyzed the effects of the state’s strict policies to regulate “competitive foods and beverages” that were sold alongside the meals governed by the National School Lunch Program (NSLP).

Read more: Get the facts on childhood obesity »

While all schools that receive federal funds for meals must have limits on the availability of foods that compete with them, California’s rules are among the strictest in the nation, the authors note.

The study looked at obesity trends among California public elementary school students in the four years before California’s rules took effect, 2001-2005, as well as the four years after, 2006-2010. Data covered more than 2.7 million fifth-graders from 5,326 schools.

The prevalence of fifth-graders who were overweight or obese increased slightly each year from 2001 to 2005, from 43.5 percent to 46.6 percent. The rate stabilized from 2006 to 2010, dipping slightly from 46.2 percent to 45.8 percent.

A student’s address mattered in determining his or her chances of being overweight or obese.

Fifth-graders were most likely to be overweight or obese if they attended a school in a low-income neighborhood. They were least likely to be overweight if they lived in a wealthy neighborhood.

By 2010, the prevalence of students who were overweight or obese was almost 53 percent in the lowest-income areas, compared with 36 percent in the highest-income areas.

“Even though the changes are small, this is one of the few cases where we have actual evidence of improvement linked to a policy change,” obesity researcher Susan Babey of the UCLA Center for Health Policy Research, who wasn’t involved in the study, told the Los Angeles Times. “Things aren’t getting bad as fast as they were before.”

Even though it’s harder to get a soda on campus, children in lower-income neighborhoods are disproportionately targeted by food and beverage advertising, said Elizabeth Velten, state and national policy director for the California Center for Public Health Advocacy (now known as Public Health Advocates), who wasn’t involved in the study.

Their parents also lack nutrition knowledge and face steep prices for healthful fare, she said.

“The healthy choice is rarely the affordable choice,” she told the Times. “As long as a bottle of water costs more than a soda and [food companies] market to lower-income kids, obesity and diabetes rates will go up in those communities.”

Read more: Nutritious food out of reach for 20 percent of U.S. homes with children »

Money comes into this issue in another way as well: through school financing.

Lucrative contracts with soft drink or candy manufacturers have often paid for activities that financially strapped districts could not afford.

Is having the extra programs worth the potential downside of health issues?

In the book, “Reading, Writing and Raisinets: Are School Finances Contributing to Children’s Obesity?,” the authors examine both the effect of financial pressure on school food policies and whether these school food policies help create overweight adolescents.

Co-authors Patricia Anderson and Kristin Butcher combined data from several sources.

They concluded that schools that are under financial pressure are more likely to make junk food available to their students, to have “pouring rights” contracts and to allow food and beverage advertising to students.

Read more: How can we fix the epidemic of overweight children? »

Nearly 17 million U.S. children ages of 2 to 19 are obese, according to the Centers for Disease Control and Prevention (CDC).

The current Smart Snacks in School program sets limits on calories, fats, sugar, and sodium and promotes the consumption of dairy, whole grains, protein, and produce.

Instead of sodas, there are low-calorie, low-caffeine options, and beverage choices largely consist of water, low-fat or nonfat milk, and 100 percent fruit and vegetable juices.

“Competitive foods” — including snacks that are sold in vending machines — are subject to the new rules.

Snacks must be produce, dairy, lean protein, or whole-grain products, or a “combo-food” that contains at least 1/4 cup of produce. To qualify as a snack or a side dish, the food must contain 200 calories or less; the limit for entrees is 350 calories.

Sugar and fat are also curtailed. Items sold on school property can’t contain more than 35 percent sugar by weight or get more than 35 percent of their calories from fat (or more than 10 percent of their calories from saturated fat), and no items can contain trans fat.

The biggest difference this year will be what students see around the school. If a food item or beverage is not healthy enough for a school to sell or serve, it can’t be advertised. That means no more pictures of soda on vending machines or in the cafeteria.

Katie Wilson, USDA deputy undersecretary for Food, Nutrition and Consumer Services, said many schools requested these changes.

“Education and wellness and advertising to kids about healthier choices [and] that all has to be part of the school environment just like making sure they have pencils and paper and computers,” Wilson told ABC News.

One study found that 70 percent of elementary and middle school students see ads for junk food at school, and research published earlier this year showed that kids tend to eat more after seeing ads for unhealthy food.

In some areas it’s the students who have gotten behind the healthier food movement.

In April, Public Health Advocates partnered with the Youth Leadership Institute with the goal of passing an ordinance for healthy default beverages in kids meals in Daly City, California. Two workshops were held for teenagers on the dangers of sugary beverages and the climbing rates of type 2 diabetes.

The ordinance seeks to encourage restaurants to work with parents to serve their children healthful meals. If it is passed, Daly City will join two other cities in California, Stockton and Davis, in offering low-fat milk or water as the default beverage in kid meals.

The original story was posted on April 17, 2014, and was updated on August 30, 2016.