When the second switch is thrown the cell produces a potential difference across both the red and green capacitors. Now the sum of the voltages across the red and green capacitors is 1.5 volts.
The potential difference (voltage) is the same from the top of the circuit to the bottom. Note that the voltage across the red and green does not have to be the same voltage.