I've had dozens of mains/battery devices over the years and plugging in the mains power cable has always disconnected the batteries. With older devices it was a physical microswitch (operated when the cable was inserted) that disconnected the battery circuit. With newer devices it's probably lore likely that there's circuitry detecting power entering from an external source.
If, say, the switch on a mains plug has been left 'off', or the fuse in the plug has blown, you could then end up believing that you were using mains power when, in fact, the device was taking power from its batteries.
Or, of course,it could just be a coincidence that the batteries are now flat. (Some types of batteries only have quite short shelf lives, so they can still go flat even when they've not been used).