1. Hashi likely had so much chakra that he could force his way out of a genjutsu. He already has shown he has some good chakra control(aka weakness of genjutsu, is a person with good chakra control)
2. Raikage only got caught in the genjutsu, after looking madara in the eye. You dont look an uchiha in the eye, you dont get caught.
3. There has been no proof, that any genjutsu at all will work on a perfect jin.(tsukyomi included)
4. If madara tried a genjutsu on hashi in the past, and hashi was able to break out, he wont use genjutsu, because it is ineffective
5. Hashi has one of the strongest genjutsus ever, and it is a perfect counter for a sharingan user.(bringer of darkness)
A final way to understand what you are saying.
You have 3 sports you can choose to play. You would have equal fun playing each sport. You are really good at 1 sport , and ok at the other 2.
Which sport would you choose? The one you are the best at.
Same way with ninjas. Some are good at all, while best at 1, some are great at all, and have no best, and some are terrible at all but 1
(ninjas use genjutsu, ninjutsu, and taijutsu)
SO why madara didnt beat hashi with genjutsu, is because he was better at ninjutsu, and taijutsu. HE was not a master of genjutsu, or very good at useing it in battle. This is most likely the best answer there is, without kishi elaborating.
Seriously though, people need to stop overating genjutsu. It is not a 1 shot 1 kill, even tsukuyomi.(though it comes close)
final question....do you honestly think, that the senjus, and hashi, who FOUGHT UCHIHA FOR A LIVING, would not become skilled at countering genjutsu?
It COULD be pnj, if madara NEVER attempted genjutsu on hashi in his life.
LAstly, madara has never used tsuykomi. The genjutsu the raikage was in, was simply a sharingan genjutsu like sasuke used.
only itachi has been shown to use high level genjutsu.(shishu has not been shown, so i did not include him, as not much is known about his fighting style and abilities)