。
She had a hard time educating her children.
Literal
She [topic-は] children [object-を] educate [for-the-purpose-of-のに] struggled.
~のに ('for the purpose of, in order to') is one of two distinct ~のに patterns — distinguished from the more common ~のに ('despite / although'). This goal-marking のに is used with the dictionary form of a verb followed by a difficulty/effort verb like 苦労する ('struggle, have a hard time'), 時間がかかる ('take time'). The structure: [verb-dictionary]+のに+[difficulty verb]. 苦労する captures real effort and hardship — more than just 'work hard.'