Comparative study of the electronic and magnetic properties of BaFe2As2 and BaMn2As2 using the Gutzwiller approximation