The Exp. Share and Rare Candies are similar, but they have their differences.
- Rare Candies automatically level up a Pokemon, where in the Exp. Share's case, you need to battle to earn experience.
- Rare Candies can only be used once, while the Exp. Share can be used an infinite amount of time.
- In Gen 1 and Gen 6, the Exp. Share give experience to all Pokemon in your party, where the Rare Candy can only be used on a single Pokemon.
- The Exp. Share gives EVs, while Rare Candies don't.
So, the Exp. Share and Rare Candies are pretty similar, but they have minor differences. If you want to level up your Rotom quickly, use Rare Candies. If you don't really care how fast your Rotom levels up, use the Exp. Share.
Hope this helps!