The sentence is grammatical. The math is a bit complicated to process so maybe that's what you're sensing, but it's equivalent to "Most of the students failed", or just "Most students failed", assuming "got less than 20 marks out of 100" is a failing grade. The whole sentence can be simplified to: "Most students got less than 20%". So I don't see any obvious problems with this.
(Prescriptively "less" should be used with mass nouns and "fewer" with countable nouns, but when those countable nouns themselves are measure terms for a grade, "less" sounds right to my ears. It would be odd to say "fewer than 20 marks", because the concept is a mass noun, a whole being divided, not individual countable marks independently of the whole score.)
Obviously the sentence describes an unusual and unfortunate event, but in that context it would be pragmatically appropriate. Just turn the sentence around and it should feel much better:
"Most students got 90% or higher"
Or: "Most of the students got more than (higher than, at least) 90 marks out of 100".
(Personally I would never phrase it that way, but in part because "marks" is a British term. I'm assuming it can be used that way, in the same way I would use "points". But I'd usually just phrase it more directly with a simple score or percentage, not counting individual points, at least in most circumstances.)
If you're pointing out that it sounds odd to have "most" with a low number, that makes the math a bit harder to process (as I mentioned), but it's appropriate in the right context. It might be more direct to simply say "most students failed" or "only a few students passed", etc. This is similar to some processing difficulties associated with negation, I think.