if your final rank is 2nd, then theoretically its possible that you could still beat them. Thatll depends on how high the 2nd exam mark will be. so lets say you got 95 for the exam mark, and the first person got 80, but for the moderated assessment mark, the person that came first got 95, but the 2nd placed got 90, since that is the 2nd highest exam mark.
overall
1st ranked: 95+80/2 = 88
2nd ranked 95+90/2 = 93
hope that helps