What happens if a 6v 4 Ah lead-acid battery is used in series with a 12v 8 Ah battery?
For dischargingYou now have a combined voltage of 18V, it will work totally fine initially, until you have used up 4Ah and the 6V battery is flat. At that point the bad stuff happens.
You now have a 6V battery that is flat and a 12V battery that is got 4Ah left.
Current from the 12V battery will continue to flow to your circuit but must pass through the dead 6V battery.
Series cells are connected negative to positive so this current flow into the 6V battery has reverse polarity! So your 12V battery starts trying to recharge your 6V battery backwards!!!
Nothing good comes of this.
For chargingIf you try to recharge this 18V battery the 6V will become fully charged too soon, before the 12V is finished. At this point you will start 'overcharging' the 6V battery and causing damage.
This overcharging may occur automatically as your battery charger won't correctly detect when the entire pack is charged