After Texas joins the Union it is impossible, even if it became a part of the Confederacy, the Union never recognized the Confederacy as an independent country, so it claimed all its territory. Even if Mexico were free to invade Texas during the American Civil War, the US will want it back.
In a Mexico vs the Republic of Texas, Mexico can easily overrun Texas. It didn’t do so after the treaty of Velasco because Texas independence was an established fact, even if Mexico never acknowledged it, and the US recognized and supported the Republic. France and the UK followed. So, it is not a question of capability, but of political reality.
Maybe, if the US and Mexico come to an understanding in the early 1840s, with Mexico agreeing to sell its part of Colorado, Utah, most of Nevada and Northern California perhaps with a US guarantee that Mexico can keep Southern California, Arizona, the southern tip of Nevada, New Mexico and throwing Texas under the bus while it is still independent, then sure, Mexico can come back and finish them off. France and the UK will protest but won’t go to war with Mexico over Texas if the US is not supporting them.