Does a 24V inverter consume the same amount of wattage as a 12V inverter?
I'll give you an answer covering a bit of general principles, since the specific outcome will have some dependence on the specific type of inverter.

An inverter seen from the terminals of the battery pack (however it is arranged, 12V, 24V, etc.) will look as a constant power load, i.e. as a two-terminal device that always absorbs the same amount of power, as long as its load (the bulb) draws the same amount of power. That's because the internal circuitry will try to deliver a constant voltage to the load and as long as this latter (the bulb) draws the same amount of current at constant voltage, the product \$V \cdot I\$ at the bulb, i.e. the power output of the inverter, will be constant.

Of course inverters don't have 100% efficiency, so the constant power drawn from the batteries will be higher than the constant power delivered to the load to account for losses inside the inverter.

That means that if the same inverter is capable of working with different values of input voltage, it will draw more current when it is connected to a lower voltage battery pack. The value of the capacity of the battery (ampere-hours) here is not relevant. The only thing that matters is that the same current will go through both batteries when they are connected in series.

Let's do some calculations. Let \$P_L=10W\$ be the power drawn by the bulb and \$P_i\$ that drawn by the inverter from the batteries. Assuming a ballpark efficiency \$\eta=0.9=90\%\$ you have \$P_i = P_L / \eta \approx 11 W \$.

This means that the current drawn from the battery pack will be \$I_b = P_i / V_b\$, where \$V_b\$ is the battery pack voltage, i.e. the voltage the inverter input sees.

So we have two cases:

\begin{align*}
(1)&amp;&amp; V_b &amp;= 12V &amp;&amp;\text{(single 20Ah battery)}
\\[2 em]
(2)&amp;&amp; V_b &amp;= 24V &amp;&amp;\text{(two 20Ah batteries in series)}
\\[2 em]
\end{align*}

The current in the two cases will be:

\begin{align*}
(1)&amp;&amp; I_b &amp;= P_i / V_b = 11W / 12V \approx 900mA 
\\[2 em]
(2)&amp;&amp; I_b &amp;= P_i / V_b = 11W / 24V \approx 450mA 
\\[2 em]
\end{align*}

So the capacity of the battery doesn't come into play here. It comes into play, of course, to calculate how many hours of service those batteries would deliver. In fact the capacity \$C\$ of a battery is a rough estimation of how much time the battery can deliver a given current (don't mistake C for the capacitance of a capacitor, though! They're not the same thing at all, despite the confusingly identical symbol!). Mathematically:

$$
C = I_b \cdot t
\qquad\Rightarrow\qquad
t = \dfrac {C} {I_b}
$$

Therefore if \$C = 20 Ah\$ the estimate time of service will be:

\begin{align*}
(1)&amp;&amp;  t &amp;= \dfrac {C} {I_b} = \dfrac {20Ah}{900mA} = \dfrac {20Ah}{0.9A} \approx 22h
\\[2 em]
(2)&amp;&amp;  t &amp;= \dfrac {C} {I_b} = \dfrac {20Ah}{450mA} = \dfrac {20Ah}{0.45A} \approx 44h 
\\[2 em]
\end{align*}

This is a rough estimation, since the capacity of a battery is not an exceptionally precise parameter when it comes to evaluate the service time. To be precise you need what are called the discharge curves of the battery (batteries, surprisingly, are not linear devices), as you can see in this datasheet for a lead acid battery:



Here is a zoomed pic of the curves:



Note how the service time changes with the discharge current. For higher discharge currents the battery will last less, of course, but if you do your math you'll see that it is not a proportionality law, i.e. doubling the discharge rate (i.e. the discharge current) reduces the time by more than half.



BTW, the energy in the battery is neither measured in ampere-hours (Ah) nor in watts (W), but the correct unit is the watt-hour (Wh), which is an alternative unit to the joule (J), which is the standard unit for energy. The conversion is simple:

$$
1 Wh = 1 W \cdot 1h = 1W \cdot (3600 s) = 3600 W \cdot s = 3600 J = 3.6 kJ
$$

The watt-hour is a more convenient unit when talking about devices that operate for long times and end up drawing large quantity of energy (not necessarily high power levels).

The watt (W) is the unit of power, instead, i.e. the rate of conversion of energy. \$1W = 1 J/s\$ Something drawing 1W from a source means that the device is converting/transferring/utilizing 1 joule of energy per second, i.e. for each second it is working a joule of energy is drawn from the source of power it is connected to.

The capacity of a battery C is a rough estimation of the energy stored in the battery. I cannot say why the industry introduced this strange unit, since you could well give the energy stored in the battery as a figure in watt-hours (and the manufacturers often do that on their technical datasheets). I can only guess that, since a battery is a roughly constant voltage source you can (very roughly) say that the capacity is proportional to the energy stored inside it, so it is easier to talk about ampere-hours, since amperes are more easily measured with common instruments, such as digital multimeters (which ordinarily cannot measure power directly).