It's really not an either-or situation. You can encourage people to be generally healthier, and
also encourage them to get vaccinated (or force them).
And if you compare the two, the vaccine is much closer to a magic cure - it's very dependable and takes "1 month" to work (assuming a two shot vaccine). Whereas encouraging people to be less obese is both incredibly hard (as decades of campaigns prove), and even in the best case scenario, would take a long time for most people.