I think that is sth set by design. If you turn the group layer on, all the layers in the group will be turned on. If you turn the group layer off, all the layers in the group will be off. So how to turn on/off certain layers? I think that you don't need to worry about the group layer, just turn on/off the certain layers should work. At least this is my experience with ArcGIS Desktop. I think this should hold true for java script api too. Please try my idea and see if it works.