What did they control for?
I'd expect those who eat healthy to also be more likely to exercise. If so, it could be exercise slowing cognitive decline rather than diet.
Or sleep. Or income. Point being, there are a lot of variables correlated with "not eating junk food" that would more intuitively predict slowed cognitive decline.