Two million road users caught committing offences were allowed to take retraining courses to avoid prosecution last year