Syphilis was a known cause of dementia in those days, so if that were the diagnosis they might have said so, but if the institution just "acquired" the victim in a late stage there might not have been a known history so they might use the catch-all "terminal dementia".
But many, many other conditions are also possible. Someone on my tree had a record of off-and-on mental illness and died in an asylum; I suspect what he had was mercury poisoning from his career as a Dagerrotypist. They had the same exposure as the "mad hatters". Then there were Van Gogh and others who worked with lead pigments. The list goes on.