It's a REALLY bad idea though, a PIC isn't specifically current limited to 25mA, it's rated at taking no more than 25mA from it - using resistors is good practice, for good reasons - use them!!!.
done right, I guess a PWM approach could work but Nigel is absolutely right - bad idea. What's a resistor cost?
bananasiong, yes, it does have something to do with the input voltage. see my earlier post. Total watts dissipated is a product of (Vin-Vout) * average current. Heat produced is a function of dissipated watts. Reducing Vin reduces dissipated watts and thus reduces heat.
On the subject of 9V batteries. This is a bad idea in general since you are wasting 4/9 of the energy and a 9V battery has very little capacity to start with. Unless you like replacing the battery frequently...