What happens to Diplomats when a regime falls?

As Libyan diplomats across the world have resigned in protests of the blatant attacks by Gaddafi on his own people we have seen some ambassadors refuse to step down and back the regime, in particular I’m thinking of the head of the UN mission Abdurrahman Mohamed Shalgham, what happens to these diplomats diplomatic protection if the regime itself falls?

Surely they are complicit in the crimes against humanity being committed against their own people by their administration. So if the regime falls would it be possible for them to be arrested and held with a view to charging them for that complicity?

I’m interested in anyone’s thoughts on the topic in the comments below.