、。
She studied hard, but she didn't pass the exam.
Literal
She [topic-は] with-all-one's-might [adverbial-に] studied [although-けれども], exam [in-に] didn't-pass.
一生懸命 takes optional に as the adverbial marker — 一生懸命 and 一生懸命に are both acceptable, with the に version slightly more careful and frequent in writing. けれども is the more formal cousin of casual けど; it sets up a stronger 'although' contrast than the soft trailing が. 試験に合格する uses に — the exam is the goal/target one 'reaches' or 'matches up with,' not an object one 'does.' Compare 試験を受ける ('to take an exam,' where the exam is the object).