Bioreactor for removal of nitrates in agricultural water