We introduce a class of Markov chains that includes models of stochastic approximation by averaging and non-averaging. Using a martingale approximation method, we establish various deviation inequalities for separately Lipschitz functions of such a chain, with different moment conditions on some dominating random variables of martingale differences. Finally, we apply these inequalities to stochastic approximation by averaging and empirical risk minimization.