Is batching a way to avoid local minima? That is my question: is batching one way to prevent the model from falling in a local minima? What is the difference between bach=1 and batch=32 in those terms?

no rather the opposite. gradient descent -ie using whole dataset to compute gradient suffers from local minima.
taking a random sub sample (minibatch) can avoid local minima because you are adding noise- which effectively changes the error surface possibly removing the local minima (or introducing new one).  However, too much noise (eg batch =1) and you are just solving for one sample and then undoing effects to solve for the next (depending on learning rate).
a Minibatch eg 32 therefore is a compromise. In addition, there is a computational issue, using minibatch instead of full batch can give you almost the same gradient as using the full batch at much less computational effort. ( law of large numbers effect - std dev decreases with sqrt(samples)).
so if my gradient error is ~ x with 32 samples, then i need 3200 samples to get gradient error ~ 1/10 x.
