Depends on the person. If someone is eating such a large caloric excess and consuming highly processed calorie dense foods, changing diet is the only way out. You’re not going to out-exercise a 1000 calorie excess every day.
The average person might only be eating 200-300 calories more than their grandparents did, though. That’s actually within the range where you could overcome it with daily activity.
Really though, this isn’t a situation where you should pick or choose. Most people should be improving their diets and getting a little more activity.