The Wakashu were young men who liked like young women, providing a sensual or sexual role for men, women, courtesans and geishas. The Kagema came after the Wakashu. They were young men who provided sensual and sexual services to both men and women. They were not necessarily prostitutes or sex workers, they merely provided additional services that were not being met.
To make it clearer, in early Japanese mythology, and life, the Kabuki would also provide sexual services. But this changed in the mid 1600. The actors acted and provided entertainment, but somebody needed to provide lighter, or sexual, entertainment. This was the Kagema, employed by the theatres, to provide sex. There were both male and female Kagema.
Kagema are widely portrayed in Japanese paintings and etchings, and make up a large part of shunga art. You may see an image of a male Kagema with a wealthy female client. Or the other way around!