Speedo and Battery are most likely different conditions at the same time. If your battery won't hold a charge, the only solution is to get one that will.
Speedo sensor you could remove and put in a warm (not hot mind, just warm) oven for a few hours, put it back on temporarily to see if it works, and if it does, seal around where the cable goes into the sensor. This in the past has been known to leak and cause trouble. Unfortunately mine was toast, and didn't come back from the dark side - had to buy a new one.