Did you use the same batteries all the time? Perhaps they have had it?
See if you can measure the voltage under load just before it cuts out.
My guess is that the batteries are not holding their charge anymore.
A "Watts Up" meter as used for electric RC-gear is very handy on our bikes, it will measure volts, current and power as well as accumulated milliamphours. They cost around USD 50,-
Helge
Edit: I see that Muzza just beat me on the finish line, but we seem to agree on the cause of your problems