Answer:
If you want to battle Palmer,you need to battle 21 trainers
If you want to beat Thorton,you need to battle also,21 trainers
If you want to battle Dahilia,battle 21 trainers(also!)
If you want to battle Darach ad Lady Caithlin,battle 21 trainers
But if you want to battle the battle hall brain,(do not know the name) you will need to battle 51 Pokemon (not trainers)each trainer has 1 Pokemon.
Hope I helped!