Couple things come to mind (below). Easy first-things worth spending a few minutes to look into. BTW, were there any stored codes? You might swing by the part's store and have them read your truck's computer codes in case you don't have a scanner.
Win Module is the box containing a couple circuit boards which is behind the key (other side of the dash board). There are contacts in there which after a while don't make good contact (can be bent back ..or cleaned), or sometimes solder joints get back and rear their head now and then. These problems seem to be made worse by using heavy keychains that put more pressure on the key switch area (part of the WIN module). Back in the day there were almost daily posts that had to do with WIN modules. There are a lot of Youtube videos how to fix them.
Ground issues - If there were ever a vehicle that was more sensitive to ground & battery power problems, the Ram seems to be one of them. Ensure your truck battery cable connections are good, and battery to body/engine connections are good. There is a major ground connection on my truck above the driver's side front tire (behind plastic wheelhouse door) that has gotten really rusty. Check that. There's also one back by the fuel filler neck. Worth making sure they're good.
Fuses/relays - It's worth wiggling fuses & relays in the underhood fuse area, to make sure they're seated. You might pull a few up to make sure the fuse pins don't have corrosion on them. You might even swap a few (like) relays. If the problem happens again, you might get out and gently tap some of the small relays with the back of a screwdriver handle, in the fuse area, and see if that resolves anything. Those relays aren't that expensive, and you never know.
Power Bar/Fuse - There is a metal bar in the fuse box area where the large cable connects to. Loosen and re-seat the nut to make sure it's got a good connection.
Starter Connection - There's also the main power cable which goes to the starter. Might be worth a look up at it with a flashlight ...even check the bolt for tightness. Be careful your wrench doesn't touch any metal (SPARKS!!) .....
_______