I think I finally worked it out.
So Melody/River applies the poison on her lips and gives the Doctor a lethal kiss. Then she jumps out of the window after sending a blowkiss (so now she has poison on her hand as well as her lips). Then she walks into some nazis, and provoke them so that they shoot her, and because she is still regenerating some regeneration energy bursts out repairing all the damage. So that's when the poisoning gets cured.
The poison itself couldn't trigger the regeneration, that's why the Doctor was dying. But Melody/River was already regenerating. That enabled her to use the Judas tree poison, because she just needed to get hurt again to trigger the ongoing regeneration that cured her.