Part of the reason Mexico lost the Mexican-American War was the inferiority of its artillery.
Mexico used older guns which were very slow to move and essentially had to be fixed on the battlefield, while the Americans employed much lighter guns.
Using a doctrine called "flying artillery", in which the artillery would be fired and then quickly moved to a different position, they made the wide Mexican infantry lines terribly vulnerable and their artillery totally outclassed.
Santa Anna attempted to use cavalry charges to catch the American artillery out in the open, but the men were so fast that the cavalry couldn't get to them quickly enough to avoid a countercharge from the enemy cavalry.
Barring actually improving its artillery, which would require political stabilization so that Mexico's economic and intellectual power could develop properly, what tactics could Mexico have employed to effectively counter this American advantage?