  In ergodic stochastic problems the limit of the value function $V_\lambda$ of
the associated discounted cost functional with infinite time horizon is
studied, when the discounted factor $\lambda$ tends to zero. These problems
have been well studied in the literature and the used assumptions guarantee
that the value function $\lambda V_\lambda$ converges uniformly to a constant
as $\lambda\to 0$. The objective of this work consists in studying these
problems under assumptions, namely, the nonexpansivity assumption, under which
the limit function is not necessarily constant. Our discussion goes beyond the
case of the stochastic control problem with infinite time horizon and discusses
also $V_\lambda$ given by a Hamilton-Jacobi-Bellman equation of second order
which is not necessarily associated with a stochastic control problem. On the
other hand, the stochastic control case generalizes considerably earlier works
by considering cost functionals defined through a backward stochastic
differential equation with infinite time horizon and we give an explicit
representation formula for the limit of $\lambda V_\lambda$, as $\lambda\to 0$.
