My 5105 was doing the same thing, sometimes cranking over sometimes not even a click. It tuned out to be the ground cable to frame connection. The frame was painted there so the only contact was through the bolt's threads. I removed the paint and reconnected the cable, all good now.
My 5105 was doing the same thing. Yesterday I removed the ground cable from the frame, cleaned up the rust and scale and reattached the cable. The tractor fired up immediately and I just checked it again today and it turned over immediately. This was an easy and economical fix.