tolipanebas,
Your logic sounds okay but lets just see where it takes us.
In parallel we have 12 volts producing a total current such that a 12AH battery lasts for 80 hours.
Each battery is therefore producing 1/2 amp. The total current is therefore 1amp.
Now if 12 volts produces 1amp then the resistance of our circuit is 12 ohms.
If we now connect the batteries in series using the same load, we now have 24 volts across a 12 ohm resistnace. This gives a current of 2 amps.
Each battery is now applying 12 volts and passing 2 amps. So the batteries will now last for 40AH / 2A = 20 hours.
This option is not included in your question.
I suspect you have assumed that the batteries in series would produce the same 1 amp current as they did in parallel. This unfortunately is not how electricity works. And this was after all a question about electricity.
The original question should ideally have said something like
"when connected to a circuit a single 12V 40 AH battery lasts for 40 hours. If an identical battery is now connected in parallel with the first, how long will the batteries last if their internal resistances are ignored?
The correct answer would then be 80 hours.