Just to make things clear.
Both 頭 and 脳 exist independently from their phrasal use and are completely different words. Also, none of them means “intelligence” or “smartness” per se. These are secondary meanings that will only appear when used in a figurative way with proper adjectives or verbs following.
頭:Head. Where not only you brain is, but your face, ears, throat, hair, etc are too. It’s also connected to your neck, has bones inside, etc.
脳:Brain. A specific organ that happens to be placed inside your head. It has several functions, has neurons, it’s soft, etc.
That’s why there are countless sentences that can only be said with one or another.
この帽子は私の頭に小さすぎる。
彼は脳外科の先生です。
先ほど頭をぶつけてめっちゃ痛い。
脳は神経系の中枢である。
However, regarding their figurative/phrasal use, they can indeed be very close, since both are related to thinking skills in a broader sense. That’s why replacing 頭 for 脳 in many figurative sentences works just fine.
Japanese as a language has as many ways of saying one is smart/intelligent one could expect. 頭がいい and 学者バカ are two of them. 学力のある、頭の回転が速い、賢い、ずる賢い、知的、知性のある、洞察力のある、察しの良い、知識豊富 are some of the countless other ways of saying it, each with different nuances of book/street smart, reasoning, knowledgeable, etc.
In that sense 頭がいい is one the broadest and simplest ones, being possible to use it in both suggested contexts:
彼が本当に頭良くて何でも察せる。気を付けたほうがいいよ。
また満点取れたの?どうやってそんな頭よくなれるか教えて、マジで。
脳がいい is not a set phrase as 頭がいい is. But since the figurative meaning is pretty much the same, on most situations Japanese people would follow it without a problem.
Also, I do not think 頭 and 脳 have a specific nuance difference when used in this way. If anything, 脳 is a “fancier” word than 頭がいい, which is elementary school level vocabulary, so maybe you could use it as emphasis.
About the 「アイツは本当に脳が弱いよな」 example, I do not think it necessarily means an actual disability/disorder. Here too brain is being used in it’s figurative sense and could be replaced with 頭 if so desired. For instance, when talking with a 6 years old, I think any Japanese adult would replace it without a doubt.
Also, 弱い is a pretty weak (no pun intended) and common use word. If you wanted to imply an actual disorder you would need to be a lot more specific. With this wording you are just saying you find them… “not really gifted”.