My 2nd key that I was given by my late nephew had never worked. So searched around for a solution to no avail.
UPDATE: This process worked for me.
The original functional keyfob must be present.
Use the 2nd, non functional keyfob to start the car.
Drive about 2 miles, turn the car off and the 2nd keyfob started working and has been working since.
So that might be an option for some of you.
Seconding this for the benefit of searchers. My car flashed at me, indicating that my remote battery needed changing. Fine. I also put a new battery into and checked my spare remote as I always do when the everyday carry one needs a new battery. Dead as a doornail. It worked to start the car (with the known-good remote far away) but wouldn't activate the locks at all.
I figured the first step would be to confirm that the non-functioning remote's transmitter was working to eliminate the possibility of a bent or broken contact. Batteries Plus does indeed have a tester that shows if a remote is transmitting (but doesn't show anything about whether correct codes are being sent). It checks chip key function, too. But, in my case the fact that the key started the car took care of that.
I drive to Batteries Plus (1.8 mi.), using the "non-functioning" key to start the car, with the known-good remote in my pocket.
Upon arrival, the "bad" remote had regained function. It opened the locks just fine. It did pass the store's transmitter test as well. I bought a couple 2016 batteries and went on my way.
Apparently, the car reprograms a remote if its chip key is valid and a good one is present. I have no idea whether or not the remotes have to be members of a matched set or not. The car would need to be started, with the ignition lock opened, but I doubt it can tell which key is actually in the physical ignition lock.