It’s extremely nuanced. ‘Light years ahead’ is correct since you are thinking about a race where one competitor is a long distance ahead of others. On the other hand, ‘light years away’ doesn’t make sense, since we think of achievements in terms of time needed, rather than distance.
https://www.merriam-webster.com/dictionary/light-years ahead
It’s extremely nuanced. ‘Light years ahead’ is correct since you are thinking about a race where one competitor is a long distance ahead of others. On the other hand, ‘light years away’ doesn’t make sense, since we think of achievements in terms of time needed, rather than distance.