I've had that happen with my SL's key remote. Even though the batteries were OK, they were not making solid contact.
I could get the keyless entry to work with the battery flip door off because I was applying pressure with my thumb. When I put the battery door back on, it would not respond!
So I adjusted the contacts in the battery compartments and it worked (after I re-sync'ed the unit with the car).
2009 ML350 (84K) - Family vehicle
2001 CLK430 Cabriolet (71K) - Wife's car
2005 BMW 645CI (124K) - My daily driver
2012 Mustang V6 (60K) - Daughter's car