Probably bad batt connections or grounds. Does your truck have the remote fob?
Couple Specifics come to mind:
Electrical Connections: The least expensive place to start is to wiggle and re-seat all the fuses in your fuse panel (by the battery). Sometimes that solves a 'wierd' problem or two. Pull some fuses (not your airbag fuses) just to see if any are not clean metal.
Battery Connections: Tripple-check your battery connections and batt cable ends. With the amount of electronics on modern vehicles, the connections to the battery need to be top notch clean and battery solid. Maybe have a parts store load-test your battery. A failing battery can cause all sorts of strange-looking issues that make owners think something major is going wrong. A couple days before my battery completely died I was getting "Module failure" warnings. Then batt died and new batt made all good again.
Grounds: Again, with the number of electronics on modern vehicles, all the switching and electrical paths from sensors, modules and switches occurs through the grounds. So it's really critical that the battery cable-to-body grounds are top notch with no corrosion whatsoever. Same with grounds to the engine and engine to body/frame. It would behoove you to loosen and wiggle and retighten all the cable connections to make sure your grounds are very good. On my H3 there are grounds all around the inside of the body on the floor and rear floor and inside that attach to wiring harnesses. Some of mine on the floor were slightly rusty. I would never have known this had I not removed the carpeting (to dry it out).
Window Control Module: I have to profess my Ram ignorance here. Mine has manual windows. HOWEVER. A flaky window control module for a lot of vehicles seems to cause the exact characteristics you described. The module manages the window and locking behavior. The exact same issue you described occurs on GM trucks and other vehicles sometimes (has happened to me twice on my H3). But I've heard it similar issues with other brand vehicles too. When it happens on GM's the windows will go down but not go back up and other interior electricals and lights act 'funny'. And the doors will not lock (or is it unlock -- I forget). If a person disconnects the battery cables and ties them together overnight (unhooked from the batt) it usually resolves the problem by morning ...and for a while -- a while being the key word.
The longer term 'fix' for the above issue based on many other owner's (for GMs) is to replace the window control module (a circuit board beneath the driver's window switches). I removed mine, disassembled the module and looked the board/circuits over very carefully. Using an ESR meter I discovered two electrolytic capacitors on my H3's circuit board were way out of spec. They were 'shot'. Electrolytic capacitors are small electronic components which consist of spiral-wound paper with a special conductive chemical 'paste' inside, stuffed into a small sealed canister the size of a .22 shell (ha ha). Over time ...and esp from heat (i.e. car interiors), the paste can and does dry out or leaks out, and the electronic device starts acting 'funny' because the rest of the circuits downstream are not getting the right quality electrical signal as was designed. Happens on computers, old radios, CB's and most electronics given enough time. I replaced the failed capacitors with known 'good' replacements I had (I toy around with electronics on the side) and have not had a problem since. That was 3 years ago. So, either that was the issue or the problem hasn't returned out of dumb luck.
Soooooo... start with the simplest and easiest items on the list above, then work towards the electronics (after you've done all the rest and the problem persists). Hopefully fuse wiggling, ground checking and battery testing will resolve your issue for good.
Hope this helps. Sorry it's general info, and not Ram specific. Most vehicles use similar electronic strategies these days. Best of luck