When she got lost, she thought she should have listened to his advice.

Literal

She [topic-は] road [to-に] got-lost [when-とき], his advice [object-を] listened-and-kept [conditional-ば] was-good [exclamation-なぁ] [quotative-と] thought.

Layers several grammar patterns: ~ておけばよかった combines ~ておく (doing something in advance for future benefit) with ~ばよかった (expressing regret — 'should have'). The result means 'should have listened and kept it in mind.' The sentence-final なぁ inside the quoted thought adds a wistful, self-reflective tone to the regret. 忠告 (advice/counsel) is weightier than アドバイス, suggesting a more serious warning that was ignored.