There are two electrical connections on the lower left side of the radiator. One is a two pin harness, the other a single slide on connection. The two pin harness supplies power, and if you disconnect that the thing will shut off. The single lead, when grounded, will trigger the relay and kick the fan on. Bad insulation along that wire could be causing the relay to stay closed (supplying juice), while vibration could explain the intermittency (getting bounced around to a grounded position sometimes).
To test that, you could wire a new lead from the single spade on the radiator (along the lower frame for temporary convenience) back to the junction box and see if the fan still gets stuck on (you will need a new lead to fit in the junction box harness for your temporary. Be careful no to do any damage to the plastic when removing the current lead) If the fan still runs with the new wire, the relay is sticky. Sometimes whacking it will free it up, but if its a recurring/non-constant problem, the relay may be on its way out. That requires replacing the junction box, unless you find a way to get into it. They aren't made to be serviceable
FWIW, dripping acid from the battery will wreck the relays... that's how they short out, turn the fan on, and drain a battery. Make sure you have a proper vent tube, especially if you end up with a new junction box.
If it ain't broke... well I'm sure I can find something that is