Carefully pry the battery away from the motherboard using a plastic opening tool. The glue gives very slowly under constant pressure and cannot be hurried. As the battery starts to lift you can insert the prying tool further as you continue to lift the battery.
The adhesive may still have sufficient stickiness to hold the new batteries, but if not, replace it with doule sided tape.
Solder the wires of the new batteries to the board, making sure that the red and black do to the correct pads.