Just had the identical issue as you with the water heater, only we were sleeping and it occurred at 3:00am. We woke to choking smoke and the smell of burning electrical wires. The smoke alarm, which I test before each trip, did not warn us. That will be replaced with two very good alarms.
I had previously hinged the cabinet entry area at the back of the water heater to make winterizing easier. When I opened the access area, I found the same as you. This morning, now that we are back home in the driveway, I will tackle the fix. I will replace every residential wire nut used in this unit with crimp on connectors. Wire nuts have no use on an rv other than to reduce manufacturing costs. If it happened to you and to me as well, how many other potential wire nut problems are just waiting to vibrate loose and cause problems.
Further, the breakers in the panel are not labeled correctly. An example was the breaker, factory labeled, stated microwave/water heater. I dropped that breaker to insure no further connection to the burnt out connection. Guess what, the microwave still remained on. I did not have my meter with me so I could not tell if in fact the water heater was disabled from further electrical connection. Today as well, I will ring out every electrical connection and label the breakers with the outcome.
I feel sorry for the ignorant who buy these units and do not know anything about how their RV's operate and there is no end to them on these and other forums. Hopefully anyone reading this will have these connections checked for either by a technician or themselves if they feel competent to do so.