I have no idea what type of machine that is, but it is possible that the key switch, or any of the safety switches, are dirty. Perhaps you can get in there with some compressed air or contact cleaner. Or perhaps the internal contacts are failing.
I had a similar problem with both my lawn tractor and real tractor. They would sometimes 'click' like the battery was low (but it wasn't), other times fire right up. I ended up putting relays in both ignition circuits because both had multiple safety switches, some of which weren't easily accessible. If it just the ignition switch you might be able to solve it easier by cleaning or simply replacing the switch.