She is a teenager, she is hormonal and she has 2 homes as well as dealing with her own insecurities, this is a child/young woman who really has no control over anything except her behavior.
Please get some books on how to parent a teenager. Concentrate on the girl part.
If she had one home with family that were around her every day they would have a better understanding of what is going on with her emotionally. PMS in a teenager is 100x worse than adults. If she feels everybody dreads her visits, she is going to feel that. If she is trying to begin showing her independence, she needs to be taught, not snapped at about her behavior,cause it will just perpetuate the behavior in her.
Have private talk with her and let her know that sometimes, you react, rather than pause when you speak and are really working on not doing this. Then ASK her if she sometimes does this and has regrets about it.
Get a conversation going, letting her know she is part of this family as well as her mothers home. Let her know you want her to visit and for it to be a place she enjoys, but now that she is maturing, it can look immature for her to be bossy, to roll her eyes to be having hissy fits and to not speak in a mature manner to others. Let her know you remember how that used to feel and how it is hard to not be passionate about everything, but there are other peoples feelings and they need to be respected if she wants to be respected. Also let her know that her young brothers look up to her and will want to be like her, but how is she going to feel if they start rolling their eyes at her and thinking she does not know anything?
Hang in there. I know it will feel like a lot of effort to an ungrateful shrew at first, but keep in mind she is only a 12 year old girl with a lot of physical and emotional changes going on, and her homes are probably completely different.
I am sending you strength.