How to calculate luminosity in g-band from absolute AB magnitude and luminosity distance? How can I calculate the (non-bolometric) luminosity $L$ of a galaxy (or a star for that matter) over a given band from its AB apparent magnitude $m_{AB}$ over that band and its luminosity distance $d_L$?

For instance, consider the g-band which typically has a $\lambda_{eff} = 467 \text{ nm}$ and a $\Delta \lambda = 100 \text{ nm}$. Given this galaxy has an apparent AB magnitude of $m_g = 22.5$ and luminosity distance of $1991 \text{ Mpc}$ (i.e. $z = 0.355$ if you are curious), what is its luminosity? I know I shold use the following equation, but I don't know what value to pick for $M_\odot$.

$$L/L_\odot = 10^{0.4(M_\odot - M)}$$

I tried 5.12 from a website which is the value of $M_\odot$ in g-band but it gives me a different answer compared to when I calculate luminosity using flux:

$$L = 4 \pi d_{L}^2 f_\nu \Delta \nu$$

where $f_\nu$ is flux density and $\Delta \nu$ is the frequency width of the band (this is an approximation to the integration over frequency, assuming bands are step functions). So, how can I find luminosity using absolute magnitude?

Please provide your references.
Here is my attempt to reconcile your calculations.

If the AB g-band apparent magnitude is 22.5, then the flux density in the g-band is given by 
$$f_{\nu} = 10^{(-48.6-22.5)/2.5} =  3.63 \times 10^{-29}\ {\rm erg\ cm}^{-2} {\rm s}^{-1} {\rm Hz}^{-1}$$

If the distance is 1991 Mpc, then the absolute g magnitude is
$$ M_g = m_g - 5\log d + 5 = -19.0$$

The absolute AB magnitude of the Sun in the g-band (from your source) is 5.12.

The latter tells us that the ratio of the "g-band luminosites" of the galaxy and the Sun are given by
$$\frac{L_g}{L_{\odot,g}} = 10^{0.4(M_{{\odot},g} - M_g)} = 4.45\times 10^{9}$$ 

One cannot say more than this, in particular one cannot calculate the luminosity of the galaxy, without knowing more about its spectrum.

Also note that the equation above cannot be used to find the ratio of flux in one band to bolometric flux, as I think you are trying to do. To see this, consider that the absolute V-band magnitude and bolometric magnitude of the Sun are almost the same. This does not mean that all the flux from the Sun emerges in the V band!

Your second method requires a figure for $\Delta \nu$, but you haven't said what you have used. The g-filter has a width of around $\Delta \lambda =100$ nm. Using $\lambda \nu = c$ we can say
$$ \Delta \nu  = |c\Delta \lambda/\lambda^2| = 1.28\times 10^{14}\ {\rm Hz}$$
$$ L_g = 4\pi d^2 f_{\nu} \Delta \nu = 2.2 \times 10^{42} {\rm erg/s}$$

The two figures would agree precisely if the "g-band luminosity" of the Sun were $4.9 \times 10^{32}$ erg/s, or in other words if 13% of the solar luminosity emerged in the g-band as defined above. This does not sound unreasonable, but requires a detailed integration of the solar spectrum over the actual g-band filter profile.

Additional: Just to check the numbers above, we can estimate the flux density of the Sun (in wavelength units, above the atmosphere) to be about 1.7 W m$^{-2}$ nm$^{-1}$ at 467 nm (just search on 'solar spectrum' for many examples) at a distance of $1.5 \times 10^{11}$ m. Putting these numbers together, I calculate a "g-band luminosity" for the Sun of 
$$ L_{\odot,g}=4\pi d^2 f_{\lambda}\Delta \lambda = 4.8\times 10^{25} \rm W$$
which is indeed 13% of the solar bolometric luminosity.