TOKYO — From a young age, Satomi Hayashi studied hard and excelled academically. It seemed only natural that she would follow in her father’s footsteps and attend the University of Tokyo, Japan’s most prestigious institution.

As soon as she was admitted, her friends warned that she was spoiling her marriage prospects. Men, they said, would be intimidated by a diploma from Todai, as the university is known in Japan. Spooked, she searched Google for “Can Todai women get married?” and discovered it was a well-trod stereotype.

The admonitions didn’t stop her. But Ms. Hayashi, 21, wondered if other women were scared off.

When she arrived three years ago, fewer than one in five undergraduates at the university were women.

The dearth of women at Todai is a byproduct of deep-seated gender inequality in Japan, where women are still not expected to achieve as much as men and sometimes hold themselves back from educational opportunities.