This just happened to me last week. I have since changed the fob battery but no change. Then I found out how to re-connect - or re-pair - the key to the car.
Open the car with the other key
With the door shut put the faulty key into the ignition
Turn the key from position 1 to position 2 and back 4 times - you should hear a beep, such as when the lights are left on
Take the key out of the ignition and press any button - you should hear the beep again
Then try the buttons. It took a few presses but then it was working perfectly.