They are mostly useful in determining prior knowledge of the solution. For other people coming up with the a-ha solution during the interview is hit and miss.
No, not at all. Properly used, the interviewed party is supposed to be instructed that if they already know the answer, they should inform whoever is interviewing them so that a different question should be picked.
The goal is not to see if the person can get the answer. The goal is to see how the person approaches unexpected or novel problems.
That is why the person being interviewed is instructed to "think out loud" when asked these sorts of questions.
"The goal is not to see if the person can get the answer. The goal is to see how the person approaches unexpected or novel problems."
Then maybe we use different definitions of "brainteaser". My definition of brainteaser is a problem that needs a single clever, non-obvious trick to solve. Groping for a clever trick is usually very random and doesn't tell me much about the skills of the person trying to solve the problem.
If I want to judge someone's approach, then open-ended problems where you have multiple solutions (preferably involving several easier-to-get steps) are much better than single-insight brainteasers.