It is shown that the tension between recent neutrino oscillation experiments, favoring sterile neutrinos with masses of the order of 1 eV, and cosmological data which impose stringent constraints on neutrino masses from the free streaming suppression of density fluctuations, can be resolved in models of the present accelerated expansion of the Universe based on f(R) gravity.