An attack by an alliance of insurgent armies has dealt Myanmar’s military a serious setback.