Here's my strategy, it's worked for every game. First, level up to 5 levels above your rival's poke when you first battle him/her (for red etc, consider the second battle). Next, train 5 levels before each gym (which becomes REALLY frustrating for Petalburg, since the wilds are really low levelled). Next, train 10 levels before the e 4 (usually a breeze, thanks to victory road). Yeah, i know, it's really harsh, but that's the way it is if you want to cruise through the game...