In order to battle a leader, you must have all badges more than 3 places below them! This only applies to Block A. In blocks B & C, you must have all badges more than 4 places below them. For the highest gym leader, all badges are required.
These are the blocks.
Entry Block
No badges are required to face any of these leaders.
Obito
Laura
Shadow
Seria
Block A
You need all badges 3 places below these gym leaders to battle them. I.E to battle Tessa, you must have Obito's badge. For Erika, you need Laura and Obito's badges. What you do is you count 3 places below the leader in question. Any badges after the leader 3 places below are required to face the leader you counted down from.
Tessa
Erika
Corona
Lucy
Block B
Same principles as Block A, only 4 places below.
Regalia
Silver
Melody
Niome
Block A
Same as B.
ShadowLatios
Eliot
Alan
Erza
Block S
You need all badges to face the leader in Block S!
Salt