User blog comment:FairyRaven/Fairy Tail Chapter 365: Fairy in the Jail!, Review and Commentary/@comment-7418318-20131228152842

I just thought of the perfect way to get them out of there.

First Natsu is beaten and captured too. Mirajane is able to controll this transformation that Kyouka put her through either because the process doesn't work on someone who's already linked with Demons or due to her experience in subjugating Demons, but Mira pretends that she's under Kyouka's control.

Kyouka then parades the "enslaved" Mirajane in front of Natsu and Erza (who have been locked into the same cell for this purpose) and orders Mira to torture her former friends. But at this moment Mirajane reveals that the mind-control didn't work, defeats Kyouka and escapes with Natsu and Erza.

Alternatively maybe the mind-control works initially, but Mirajane is able to fight through it and regain conrol over her own body when she's supposed to torture her friends.