"A substantial proportion of obese U.S. adults who attempted to lose weight reported weight loss, at least in the short term. Obese adults were more likely to report achieving meaningful weight loss if they ate less fat, exercised more, used prescription weight loss medications, or participated in commercial weight loss programs."
Also somewhat interesting that eating diet products negatively correlated with weight loss
One could read that as exercising more or eating less both work.
Caveats for the pedantic:
If you've found yourself overweight and sedentary, you are unlikely to adopt a level of exercise needed to outrun your bad diet.
All else being equal, the person with the better diet will have a better body comp (or achieve a goal body comp easier).