When I was a kid I would go to NY in the summer to spend a few weeks withat my cousin. I looked up to her, she was very pretty and popular while I didn't have the best self esteem.
After spending a week or two with her I picked her her sayings and, believe it or not, the ny accent. It wasn't a conscious thing I was doing, I just was so used to hearing it is picked it up.
It would fade away, mostly because my sister would kind of make fun of me and embarrassed me about it. I was older then your son, I was 11. If I had to guess, I would say your son is probably so happy to be a part of his brothers life. They share a mom, correct?
He's only 6 and I'm sure he's thinking things like "why does he get to live with mom, but I dont" even tho I'm sure he's very happy with you.
So he probably idolizes the 12yr old and wants to be like him. Maybe just remind him that when he does these things,not only can it be a little annoying to others but it also isn't who he is. Maybe tell him how awesome of a kid he is and how you and his mom love him and he's perfect the way he is, and shouldn't "copy" things his brother does.
He might not even realize he's doing it.
Not sure if that helps at all, but maybe when you talk to him you can say something like "every time you act like your brother I'm going to say the word (pick and fun word) to remind you that your doing things he does"
I have amy 11yr old daughter from a previous relationship, and a (almost) 6yr old son with my current husband. My daughter hasn't seen her father since she was 4. She is angry and has a bad attitude. When my son acts like her I say to him "this is hoe your sister acts, it isn't ok when she does it and it isn't ok when you do it" sometimes he says ok, sometimes he gets more upset. They look up to their siblings, and they think their siblings are "cool" and can do no wrong.
Whatever you decide to do, tell your ex and ask her to please go along with it to break the habit. Not sure how she is but it'll be confusing to be allowed to do things with one parent that you can't do with another.