Use the Tri-Pass to travel to the Islands and train your Pokemon there. Mt. Ember and Berry Forest are home to Pokemon of up to level 40.
If that takes a long time, remember that your EXP points are higher when you're fighting Trainers. Choose a spot with lots of Trainers (like the six Bikers at the top of Cycling Road) or very strong Trainers (like the Black Belts on Kindle Road, One Island) and use the VS Seeker. (I train against the Black Belts, because they're right next to the Ember Spa which can heal your Pokemon any time they get weary.)
If your Pokemon has a tough growth curve (i.e. it takes ages to gain levels, like
), bring along a
while you train, for its Pick-up ability which occasionally finds vitamins and Rare Candies.
I recommend bringing your team to at least level 50 before taking on the Elite Four.