The incident happened at about 18:00 on Saturday on Station Road in Selkirk.
The man is described as between 30 and 40 years old with short, dark hair which might have been a wig.
He was wearing a dark coloured dressing gown and outdoor shoes. Police said he might have come from the direction of the town's Muthag Street.
Insp Bryan Burns said: "This indecent and inappropriate behaviour is totally unacceptable and has left the two witnesses understandably distressed.
"We are keen to hear from anyone who may have seen this individual or who has any information that can assist us in identifying him."
A man who may have been wearing a wig has indecently exposed himself in front of a woman and her young granddaughter in the Borders.