I am not sure there is an actual "problem" here. I might be biased on the topic though because my son was only two when he asked me to stop stealing his hair (his explanation of having had his hair cut) and so I did & let him grow it. Later he wanted it cut again, then not. I don't mind one way or another as long as it's clean & taken care of, he can have any hair he wants.
He also used to love having his fingers & toes painted, putting on my makeup, etc. He had a huge box of dress up things & he often interchanged being male & female characters. He outgrew most of that, still loves long hair & seems to me to be a well adjusted average boy of his age. My 2nd son showed less interest early on, but later wanted long hair too & now he too has grown his out.
My youngest is a girl, 3 & recently told me she wanted her hair cut. I said okay. I should have been more specific about it because she took it upon herself to take care of that. So now she is my child with short hair while my boys have very very long hair.
It really isn't something you have to worry about. I know many parents do, but if you stop & reflect, it's hair. It grows. You can cut it 100 times, and it still grows. You can grow it 10 years & in 5mins you can shave it all off. If he likes long hair, then he likes it. If he likes pretending to be a girl, that isn't anything either, other than play. He likely also likes to pretend he can fly, drive a bus, be a firefighter, be a doctor, etc.
As far as role models, all children need good solid strong male & female role models in their lives regardless of whether you are raising sons or daughters. Ideally that would be mom & dad primarily & then others who are close family or friends. If mom or dad is absent, then seeking out more time with a grandparents, aunt/uncle, etc is a good idea to allow a child to see examples of adults they can identify with on gender AND that are examples of things you hope they will aspire to become, responsible, kind, reliable, trustworthy, honest, hardworking, etc. You do want your children seeing examples of the types of adults you hope they will aspire to be and the type you hope they aspire to date.