Prospects for annihilating dark matter from M31 and M33 observations with the Cherenkov Telescope Array