Sorry for the late reply.
"sit for an exam", yes, so "for" works. Mind you, "barred" is still somewhat problematic, in my humble opinion. You've barred from, which is fine, but it's followed by "for" which plays semantics with "barred for (taking the final exam)".
Students ... will be barred from sitting for the final examination.
I'd axe "barred". What about?
... will not be permitted to sit (for) the final examination.
- For Teachers