When thinking about the last judgment, we have to remember the proper role of the Law. Namely, it is a spiritual role. We are not just judged because we fail to outwardly obey the commandments, we are judged because we are inwardly rebels and hate God.
The coming of Elijah [i.e. John the Baptist] announces the salvation that will come through Jesus.