That's why you have to work equally hard or work harder for an external exam in order to maintain that top rank. Besides, the moderating process should take care of school assessment marks being too high. The marks that the school submits are not the marks that you recieve nor are they the marks that are used for scaling. They are almost always moderated. Once moderated, the assessment mark is combined with the raw examination mark.
So if the top ranked student got a moderated school assessment mark of 97, and a raw examination mark of 77, the raw HSC mark would be 87. Chances are, that the top ranked person may have had luck on his or her side during school assessments and that luck ran out when it was time for the external exams.
If a 5th ranked student in that same school got 77 for a moderated assessment mark and 97 for a raw examination mark, then the raw HSC mark would equate to 87. Chances are, that this student may have studied intensively before the external exams unlike his or her school assessments.
Notice that the raw HSC marks of 1st and 5th in that school are the same. Both your examination mark and assessment mark are important for determining your UAI. If one has low assessment marks, then he or she can push his or her ranking up by excelling in the external exam. In most cases, the moderated school assessment mark and the examination mark should be roughly similar.