You actually don't need to lose a battle to trigger the ending dialog, merely clicking on the final node again after beating it and then cancelling the dialog box will play the ending sequence.