This is seriously Game Freak's problem. xD But...
My Illogical Theory
Well, in FR/LG and the anime, Red/Ash and Blue/Gary are rivals. We all know that. They become rivals and then later Blue becomes the champion. Blue, in FR/LG, then getting defeated by your character, then no longer becomes the Champion.
While, in FR/LG Giovanni was the final gym leader. After we unmask he is the leader of Team Rocket, he is evidently kicked out of the gym, nowhere to be seen. (As showcased in HGSS) and due to him being missing, they had no 8th Gym Leader. That's when the previous Pokemon League Champion Blue, then becomes the highest ranked Gym Leader of Kanto in HGSS, while Red, the current Pokemon League Champion, goes into Mt. Silver.
So he takes up different roles throughout the generations, but that's probably the most logical explanation on how Blue takes his role in the Pokemon games.
Hope I helped. :)