She was lucky to have passed the exam.

Literal

She [topic-は] exam [target-に] passed [and-て] fortunate was.

通る ('to pass through, get through') is the more colloquial counterpart to the formal 合格する for passing an exam — both take the exam with に. The te-form 通って here links cause and effect: passing the exam is the reason she was fortunate. Japanese frequently uses bare ~て for this 'because / and so' linkage where English would prefer an explicit infinitive ('lucky to have passed') or causal connector. The connection is implicit but unambiguous in context.