There has been a push in recent years to improve things, driven by government initiatives to address Japan’s dwindling workforce as a result of the dwindling population (in other words, these initiatives aim to kill two birds with one stone: keeping women in the workforce while making it easier for them to have children). This has led a lot of major companies to offer more robust maternity leave, childcare leave and adjusted working hours for those with young children. A lot of companies are also updating their rules to combat matahara.
That said, these initiatives are all extremely new and so their larger impact is unclear. Also, although maternity leave is a legal right, the other guidelines from these initiatives are just that, so I doubt that many smaller companies follow them.