Frstly - thank you for using the MPLAB template, it makes the program far more readable and logical than we often see.
No circuit will work without power so as suggested earlier, the PIC and MAX232 are continuing to run on energy stored in the power supply capacitors. If it causes you a problem, try connecting the reset (MCLR) pin through suitable voltage limiting components to a sensing circuit at input of your power supply. You could also try enabling the Brown-Out detection circuits (CONFIG2L register) to force a reset sooner as the VDD voltage starts to fall rather than letting it go down to around 2V before it stops running.
Brian.