I've seen this before. Usually the temperature sensor. When it fails the drop in water temp isn't detected so the unit doesn't relight to keep the water temp up.
Could also be the thermocouple. When it fails the gas valve closes and the pilot light goes out.
I suggest checking to see if the pilot light stays lit after the tank heats and the burner shuts off.
With all the vibration from roading and the dust and moisture that may collect on them, sometimes the electrical
connections get dirty or corrode. Although my unit doesn't use pilot lights
I just dealt with this issue regarding my fridge
. I powered it up and nothing happened. I pulled of the connections, blew out the dust and plugged them back in. Success until they get dirty again.