I assume from your post that she's doing it so much that it's becoming a hinderance. Positive reinforcement of action carries much greater weight than punishment.
You said she does it when she feels neglected. Why does she feel neglected? Is there a way you can include both kids at these times?
If not, is there some sort of reward or game you can institute to lessen the behavior? (i.e. When she hides, you call out how you're scared and you need a hug/protection from her -- or you get out a favorite toy and play with it in her line of vision to draw her out ((or give it to her brother if you want to see her come out doubly quick...lol)))
If she does this and you pay more attention to her brother while she's hiding, would that draw her out?