You cannot pass the electric fence in the ninth badge area until you've defeated the Elite Four and become Champion. It's a story gate.
Use the time to train your team for the upcoming challenges.