No, you don't get the highest mark in the exam. If you get 40% in the HSC exam, you get 40% in the HSC exam (unless you had a illness form, etc).
However, if you're ranked first, your internal assessment mark is the same as the highest HSC exam mark. Meaning that if someone gets 97% in the HSC...