Anime about a girl who escapes torture?
It's the first season of Higurashi no Naku Koro ni.

The scene you're describing is in episode 20 (about 18 minutes in).

Shion is the one with the taser. She ends up torturing killing like half the cast.



Rika is the girl who commits suicide by banging her head against a knife.