In Third Conditional sentences, we use 'if + past perfect' in the first part and 'would have + past participle' in the second part.
Therefore, the correct answer is:
If the students had not been late for the exam, they would have passed.