Reprogram them, if that doesn't help then probably the unit in your ignition aren't charging them.
Reprogramming costs nothing, so go that route first.
1. With both keys, get in the car and close all windows and doors.
2. Put key 1 into the ignition and turn to position 1 (the accessories should turn on)
3. Turn the key back to position 0 and take the key out of the ignition.
4. Using the key 1, hold down the unlock button, press the BMW logo (lock button) 3 times, and release the unlock button. Doors should lock and unlock.
5. With the second key 2, hold down the unlock button and press the BMW logo (lock button) 3 times and let go of the unlock button. Doors should lock and unlock and you're done!!
Alternate Procedure:
1. Switch ignition on and off within 5 seconds, with all doors closed.
2. Take key out of ignition and press unlock button. Hold unlock button whilst pressing the lock button 3 times, all within 10 seconds.
3. Release unlock button.
4. The system recognizes re-programming by locking and immediately unlocking the doors.
5. You have to do your other keys within 30 seconds after reprogramming your first key by following steps 2,3 & 4 only.