。
She had to study hard to catch up with her classmates.
Literal
She [topic-は] with-all-one's-might studied-and class [genitive-の] people [with-に] catch-up-must-do.
追いつく ('to catch up') is a compound verb (追う 'pursue' + 着く 'arrive'); the に marks the target one is catching up with. ~ねばならない is the formal/written must-do construction — slightly bookish, equivalent in meaning to ~なければならない. The conjugation goes through the negative stem: 追いつく → 追いつか + ねばならない. The whole sentence has a slightly literary or autobiographical feel — describing past struggle in formal-leaning Japanese. クラスの人 ('people in [her] class') is the simple way to say 'classmates.'