It is a well-known problem to e-bike riders: after some time the
range starts to drop. This will happen to every battery, no matter
what you do. The typical life expectancy of a battery is about 500
recharge cycles. At first the drop will be hardly noticeable, but
gradually the capacity will decrease significantly, until a given
moment, where your e-bike will loose all power and you will have to
push all by yourself.
What shouldn't be done is to hurry to a dealership and ask for a new battery. If by any change your bike hasn't been declared 'outdated', the price of a new battery will burn a hole in your wallet (Typical £300.- to £800.-). And if your e-bike is a bit older, a factory replacement is often impossible to find. The dealer will say he feels sorry for you... and then try to sell you a new e-bike. Your now obsolete e-bike's value is reduced to the price of scrap metal, while there is nothing wrong with it, besides the dead battery.
With a bit of snooping through the classified adds or Googling
something like "battery refurbishment" it is possible to find a
craftsman who is able to replace the dead cells with new ones. You
will save hundreds of Pounds and your renewed battery will be better
than before! Better? Yes: better, while newer technology and
higher capacity cells can replace your old ones, all in the original
NiCd cells can be replaced with NiMh to get rid of the "memory effect", and they will work with the original charger. And if you really want to step up the technology, Li-Ion cells with triple or quadruple capacity can expand your range significantly, though these will need a dedicated charger.
After I underwent CABG-surgery, I wasn't allowed to ride or drive for several months. By the time I was able to get back in the saddle, it was Winter time, and so I didn't ride my Batavus E-go for over half a year. It didn't come as a surprise to find the battery in a very poor condition: instead of the usual 12-15 Miles on the 24V 5Ah NiCd-battery, the range was down to "a couple" of Miles.
So I replaced it with a "tuned-up" battery, made by Piet Van Meel, from Holland. He used 9Ah NiMh-cells, expanding the range to over 30 Miles. The total cost was €220, shipping included. Another advantage of the higher capacity cells is that this battery will need fewer recharging, thus stretching the life-cycle.