MacBook Pro goes into hibernation immediately after login, how do I fix this?
If you've reset the SMC and it's still showing the problem, then you will need to take it in to an Apple Service Centre. The 13-inch 2012 MBP is still supported, as it was sold up to October 2016. 

The 15-inch model is considered "Vintage" and Apple no longer provides hardware support. (Though it might be worthwhile taking it in anyway and smiling sweetly: my local Apple Store says they will continue to fix vintage hardware if they still have the parts.)

Batteries are the one part of a laptop that you can expect to fail over time and need replacing. If you can get it replaced, then that's a small price to 'refresh' your laptop and extend its useful life.