FYI...
If you put the key in the correct cup holder and it did not work, it's not the keyfob battery, the reason they have this very option of putting the keys in the cup holder is for you to be able to operate the car, with the keyfob battery depleted. (And the reason for the physical keyblade in the key to be able to unlock the car with that.)
In the old days where you had a physical key you inserted into an ignition, the immobilizer consisted of a chip inside the key and a coil around the ignition keyhole, when the key was inserted, it energized the chip via induction between the coil mentioned and a similar coil in the car.
This function is what happens when you put the key into the cup holder, there is a coil beneath, that energizes the chip in the key and validates that a valid key is present and to release the immobilizer and allowing the car to start.