Mechanisms of dissociative excitation of BrCN in electron cyclotron resonance plasmas of Ar and He