Since swapping batteries around seems to frequently fix the issue I'd start by doing a thorough cleaning of all contacts on the batteries themselves and the derailleurs. As I've found with my Nikon flashes a tiny bit of oxidation on the contacts can result in zero power to the device and/or lots of fruitless battery swaps. Use some electronics cleaner and a q-tip or a pencil eraser depending on what you have handy.
Also check that there are no cracks in any of the retaining clips or whatever SRAM uses to attach the batteries. I have heard of issues of the hooks of the batteries breaking off and perhaps yours are just to fail.