Better sanitation practices also made a huge impact in better life expectancy and lower disease rates.
The vaccines likely had some positive impact, but they become less and less effective over time as each virus mutates, and the risks associated with each vaccine are real.
It’s simply not true that the Polio vaccine ended Polio all on its own, for example. Same is true with every single vaccine.