When the vaccine came out in the UK, they included a hard age cutoff: Above a certain age, you weren't eligible. Below that age, you were eligible.
They looked at the probability of a dementia diagnosis over the 7 years after the vaccine was introduced.
People who were born in the "can get the vaccine" group have markedly lower rates of dementia. People in the "too old" group have higher rates. It's cut and dry. The researchers didn't separate out the people who actually got the vaccine.
It's one of those studies where you don't even need to look at the p-value to see the difference between the cohorts.