It's no secret everything declines with age, including cognitive function. The way vegetarianism could contribute to better cognitive function into later life is because with excess muscle meat intake you build up more "growth and aging" amino acids, like tryptophan:
"In old age, the amount of serotonin in the brain increases. This undoubtedly is closely related to the relative inability to turn off cortisol production that is characteristic of old age (Sapolsky and Donnelly, 1985). Hypothyroidism increases the formation of serotonin, as does cortisol (Henley, et al., 1997, 1998; Neckers and Sze, 1976).
In white hair, the amount of tryptophan is higher than in hair of any other color. Although serotonin and tryptophan are very important during rapid growth, their presence in senile tissues is probably closely associated with the processes of decline. The hair loss that occurs in hypothyroidism, postpartum syndrome, and with the use of drugs such as St. John's wort (which can also cause the “serotonin syndrome”) could be another effect of excess serotonin."
and toxins like iron:
Role of brain iron accumulation in cognitiv... [J Alzheimers Dis. 2013] - PubMed - NCBI