However, that too needs to be studied further, the team noted.
Katan said that infection with the viruses, rather than the two bacteria, seemed to play a greater role in mental decline. Overall, 23 percent of the study participants had signs of mental impairment at the study's start; the odds of impairment were 2.5 times higher among people who carried all three viruses -- HSV 1 and 2, and cytomegalovirus -- than for people who carried only one virus.
"It's not just infection with one virus," Katan said. "It's the overall burden."
Infections alone would not be the whole story, either, said Dr. Timo Strandberg, a researcher at the University of Helsinki in Finland, whose own work has uncovered a link between herpes viruses and dementia.
Most people carry at least one of these pathogens; up to 80 percent of U.S. adults are infected with cytomegalovirus by age 40, for example. But not all develop dementia.
"Cognitive [mental] decline in old age is multifactorial," said Strandberg, who co-wrote an accompanying journal editorial.
For example, the gene variant APO E4 makes people more vulnerable to developing Alzheimer's disease, and one theory has been that if infections can promote mental decline, APO E4 carriers would be more susceptible.
There was no evidence of that in this study, however.
Strandberg agreed that more research is needed to know whether herpes viruses or other infections really contribute to mental decline.
In this study infections were linked to older adults' mental test scores at the study's start -- but not to changes in their test performance over the next eight years. It's not clear why that was, Katan's team noted.
Strandberg said he thinks only a controlled clinical trial can give answers. He said a first step could be a trial where Alzheimer's patients are randomly assigned to take an antiviral drug to prevent reactivation of herpes viruses.
But Katan said any intervention would presumably have to happen earlier. "If they already have dementia, it's too late. The damage would be done," she said.
If further studies do confirm that certain viruses play a role in mental decline, prevention would be important. Katan pointed to vaccines as a potential way to protect people, "but we're a long way off from that," she said.
The study was funded by U.S. and Swiss government grants. Some researchers on the work and Strandberg, the editorialist, have ties to several drug companies.