A woman played the part of Prince Orlovsky in one version of this opera because the part of the Prince was intended to be sung by a castrato, a type of singer which no longer exists - the practice of "creating" them was stopped ages ago, as it involved the surgical removal of the singer's genitals.
Irma Nittinger, a contralto and definitely a woman, was the first Orlowsky. Castrati were already on the way out, and actually only performed in Italy and England. Strauss was just following a tradition of women in trouser roles -think of Cherubino in "The Marriage of Figaro." 30 years after "Die Fledermaus," Richard Strauss wrote the trouser role of Oktavian in "Der Rosenkavalier" for a mezzo-soprano, and never intended it to be sung by a man.