Sometimes batteries just die - nowt you can do about tit.

I had a similar thing on my XJR1300.

Electrics were dead.

I was routing around in the wires and the ignition lights suddenly came on.

Found that I had a break in a wire - as simple as that. Found it by pure chance.
Gently push the wire with the tip of your finger and things were ok.
Take your finger away and out went the lights