'〜あげく(に)': Regrettable Final Outcome ('In the End / After All That... (Negative Result)')
[Verb Ta-form / Noun + の] + あげく(に) (Protracted process culminating in a bad outcome)
'〜あげく(に)' indicates that after a prolonged, troubled, or distressing process of deliberation or conflict, the final result was unfortunate, disappointing, or regrettable ('after all that...', 'in the end... (bad result)').
⚠ Note: Exclusively negative outcomes: The final clause must report a disappointing or disastrous conclusion (e.g. 離婚した - got divorced; 倒れてしまった - collapsed). For positive outcomes, use '〜末に'.
いろいろ悩んだあげく、会社を辞めることにした。
After agonizing over it for a long time, in the end I decided to resign from the company.
口論のあげくに、二人は絶交してしまった。
After a bitter argument, the two of them ended their friendship completely.