Fermi-LAT GeV excess and muon $g-2$ in a modular $A_4$ symmetry