The correct option is
B Not only were the boys unruly, but also the girls.
The conjunction, 'Not only.. but also' is a correlative conjunction, which combines two grammatically equal items. This means that the words which follow both parts (i.e 'not only' as well as 'but also') should belong to the same parts of speech. Using different parts of the speech after 'not only' and 'but also' makes the sentence imbalanced and grammatically incorrect.
Option A: The phrase, 'not only' is followed by 'unruly', which is an adjective. However, the phrase 'but also' is followed by 'the girls', which is a noun phrase. Hence, this option is grammatically incorrect.
Option B: When a sentence begins with 'not only, it is followed by an auxiliary verb like 'did'/does'/'is' + subject. In this option, the sentence begins with 'Not Only'. This is immediately followed by an helping verb. Hence, this option is correct.
Option C: When a sentence begins with 'not only, it is followed by an auxiliary verb like 'did'/does'/'is' + subject. In this option, the sentence begins with 'Not Only'. However, this is not immediately followed by any helping verb. Hence, this option is incorrect.
Option D: In this sentence, the phrases 'not only' and 'but also' are used together, which is grammatically incorrect.