Sorry to say this but that earbud is done for. Repairing it will cost more that a replacement (I think). Best to just get a replacement. You can try repairing it at your own expense.
There might be a faulty chip or component on the motherboard. Check if the old battery works on another 3DS. If it does, its a problem with the motherboard. If you're too scared to fix it, try get as much data off the 3DS onto an SD card and send it to someone to try repair it. If that doesn't work then you will need to get a new one. I wish you luck on fixing the 3DS.