It's an usual process of battery degradation. Any corded/cordless shaver need at least partially working battery in order to operate from the cord.
You shouldn't leave a shaver permanently connected to the outlet. Even if the battery is not holding a charge, over-charging it destroys it. A shaver's manual notes the recommended charging time. Charging for more than 24 hours irreversibly reduces the battery life.
Now the battery needs to be replaced. But there is a chance that the printed circuit board is also damaged by overheating so it may be better to purchase a new shaver. The battery(-s) is soldered to the printed circuit board - it's not an easy plug&play replacement.
A.R.S., December 2012