This happened to me last night on the side of a mountain, in torrential rain. The wire wasnt lose it just burnt out, lucky for me i have a pair of pliers and some lecky tape,
Mannaged to do a roadside fix, i saw the lights dimming and pulled over at a servo and checked the battery and the water was low in it, so i topped it up and thought thats that. But after about 30 mins the lights really dimmed (having the window defroster on full blast, the windscreen wipers on full and high beam)
I turned around and headed back down, and stopped somewhere where i had phone reception, by this time battery had completely died, sat there for about an hour waiting for a mate to bring out a new battery and remembered this post, so i checked the wire and fair enough and completely melted through the big gauge wire,
I cut the wire down and connected the the lug ring back on and was all fine after then (funny thing is i have a volt gauge and didnt even think to turn it on to check as it is quite bright and is a distraction)
all in all 2 hours in the rain, freezing cold and alone on the side of a mountain is not fun!!!
side note, the nut holding the wire in was that tight it took alot of force to undo.