When this happened the second time I bought a new battery terminal and put it in the car. Ready for me to install it. However because the problem didn't come back I didn't end up getting it installed.
Yesterday I had the same problem. I park on a slope at work and there is enough electricity getting through the terminal to hill start it, which I did. However when I got home there wasn't even enough getting through to run the central locking. So I had to fix it.