If it starts the car, it may just be that the battery is dead (the starting feature uses a passive RFID chip that doesn't need power). The non CA (Comfort Access) FOBs have a sealed internal battery that charges while it is in the slot on the dash. Put it in and drive the car for a while (I don't know, maybe an hour or so) and then try it. If it is CA FOB, there's a cover on the bottom and the battery is in there.
If all this fails, the battery may be beyond holding a charge, or the FOB broken. This is a bummer since you'll need a new one and they go for like $300 (they have to get one from the factory custom made for your VIN).