  The dispersionless longitudinal photon in Maxwell theory is thought of as a
redundant degree of freedom due to the gauge symmetry. We find that when there
exist exactly flat bands with zero energy in a condensed matter system, the
fermion field may locally transform as a gauge field and the system possesses a
gauge symmetry. As the longitudinal photon, the redundant degrees of freedom
from the flat bands must be gauged away from the physical states. As an
example, we study spinless fermions on a generalized Lieb lattice in three
dimensions. The flat band of the longitudinal fermion induces a gauge symmetry.
An external magnetic field breaks this gauge symmetry and emerges a bunch of
non-topologically chiral modes. Combining these emergent chiral modes with the
chiral anomaly mode which is of an opposite chirality, rich anomalous electric
transport phenomena exhibit and are expected to be observed in
Pd$_3$Bi$_2$S$_2$ and Ag$_3$Se$_2$Au.
