driving 2 12v 2A DC motors with Mega

The L298 motor driver is ancient and inefficient technology. They drop 2 to 4 volts and dissipate the power as heat. If your motor supply is 12V, the best that the motor will see is 10V, probably less. Modern motor drivers use MODFETs on the output and drop very little voltage and therefore waste much less power.

Do the pump motors need to run in reverse or only in one direction? If they run in one direction the driver is much simpler. A logic level MOSFET rated for the stall current is a simple driver. The flyback diode is necessary to protect the MOSFET from high voltage when the motor shuts off.