Which will provide longer battery life: 2xAA batteries in series or 4xAAA batteries in series regulated to 3V via a voltage regulator or buck converter?
Synopsis: 4xAAA + a synchronous buck converter for maximum lifetime.
This is a good question as it shows up the advantages and disadvantages of a couple of approaches to power management. The chart below shows a typical set of discharge curves for an alkaline cell.
The brown curve is at 34mA discharge current, which is greater than the 10mA in your scenario, but still broadly applicable. The first thing to note is that the battery only provides 1.5V right at the start of its life - it rapidly falls off. Since you claim to want 3V, this means that (a) there is no overhead for a linear or buck regulator here and (b) your circuit will not last long at all powered by these! If it turns out that you can tolerate voltages lower than 3V you will get a longer run time, but you certainly won't be using either of the regulators you mention. You could use a boost regulator and get more energy out of the cells by discharging them more deeply, but that isn't what you asked about so I am going to steer clear of it for now and come back to it later.
As for 4xAAA - their nominal output voltage would be 6V, so we do have headroom for a converter. A low quiescent current LDO regulator would be the linear choice here. For a 30mA output current (enough for you), 100mV of dropout voltage is not uncommon, so we shall assume that we can operate all the way from 6V down to 3.1V - that is down to 0.78V per cell - so low that it is off the chart below! Efficiency will range from 50% initially up to 96% just before the LDO finally drops out. Input current draw will remain 10mA throughout.
The chart below shows service life for a typical AAA cell (source) at different depths of discharge.
Now again, we're working off the graph which isn't great, but we can say for sure that the service life at 10mA discharge current for an acceptable cell voltage of 0.8V is greater than 100 hours. So the question is: would this be greater with a buck converter? In theory, yes, but what about in practice - do quiescent currents and switching losses swamp any theoretical gain?
This chart (taken from here) shows that >90% efficiency is possible for 6V in, 3V out at 10mA current draw.
Since the dropout voltage of a buck converter is effectively 0 (switching on the pass transistor just acts as a passthrough) we'll be going all the way down to 3V too, which will put us (slightly) deeper into the discharge curve.
So who's the winner? If you really need the full 3V, you'll get most out of an efficiently designed synchronous buck converter powered by 4xAAA cells, followed by the linear.
If you can deal with voltages lower than 3V, the 2xAA cells approach might work for longer than my initial (dismissive) analysis showed - but given the total energy in 4xAAA is about the same as 2xAA and the series + buck combination will allow for deeper discharge, you're always going to be best with the 4xAAA + buck.
2xAA stores a little more energy than 4xAAA. But it is not that simple.
A fresh alkaline battery will put out 1.6V, and discharge down to around 1V or 0.9V over its useful life. So if you go with 2xAA, you will have to use a boost converter to get 3V. Pick one that can operate down to 1.8V Vin. Unfortunately, this is probably your best choice. I know that 3.2V Vin is greater than 3V, and it may seem strange to operate a boost converter under these conditions, but it should be OK for most boost converters.
If you go with 4xAAA, that will give you a maximum voltage of 1.6x4 = 6.4V. You can connect this to an LDO and regulate it down to 3V. But nowadays most of the small cheap LDO's cannot handle 6.4V. they are all designed for USB/lithium battery systems, so the max input voltage is 5.5 or 6V. So you will need to use a more expensive LDO. Might as well just go back to the 2xAA configuration and use the boost converter in that case.
If you could do 3xAA (if that is an acceptable option), then you could use a low cost LDO and still get decent battery life. With a 10 mA load, you would probably get around 200 hours of battery life.