I have an '05 3500. Regarding getting locked out, I'll hazard a guess and say one of you hit the lock button on an armrest with the door(s) open without realizing it.....until you closed the door(s) and couldn't get in (been there, done that). The only automatic locking that takes place as you probably know, is when the truck is in motion and if unlocked, the doors will lock automatically at about 15 mph.
The second issue, sounds like a potential problem with the under hood power center (where all the fuses/relays are), they have been known to fail, or if the Ram uses it, a body control module, which controls 12v power distribution to everything inside the cab. Either way, merits further investigation (could also be the source of your lockout problem if no one hit the lock buttons, too).