Can you tell me if using these 2 batteries are the same as 1 specific battery?

The 2 batteries are rated each at 12v / 20ah. The 1 specific battery is a 24v / 20ah. I would like to know if I can use the 2-battery method or will there be an issue in the ah (amp/hour) rating? I am using it for a motor that requires 24v / 20ah battery.
2 answers 2