The minister, who was appointed two weeks ago, said she was “live” to the potential impact of ScotRail’s proposed station ticket office cuts on women’s safety.
The Mid-Fife and Glenrothes MSP said: “It’s not just about our station platforms or ticket offices.
“It’s the walk to the station, it’s the journey on the train home, it’s making sure you don’t catch the last train to Fife because it’s full of drunk men who will squeeze in beside you despite the fact you are surrounded by empty seats.
"And so you sit quietly with your headphones in, until you get up the gumption to move.
"And when you do move, like the woman across the aisle from you, you’re shouted at for daring to escape.
“[You get] ‘I’m only having a laugh’ as he shunts his leg against yours and you hope he doesn’t follow with his friend when you move away.
"So let me say to the Opposition benches, but particularly to the male Opposition members who last week wanted to tell me about women’s safety on our trains, I know all about it. I have been there.
"It is a systemic problem and it is not just about our ticket offices, it’s about all the places on our public transport networks where women are scared to go because of men’s behaviour.
“I want our railways to be safe places for women to travel.
“We need to identify, as a Government, where it is that women feel unsafe on our public transport systems, and then identify how we’re going to fix it.
"To that end, I’m announcing today we will be consulting with women and women’s organisations across the country to better understand their experiences and how we can improve our public transport system to make it safer and more enjoyable for them to use.”
The minister said she also wanted passengers to feel safe “to encourage more people to choose to travel by train – and to enjoy doing so”.
Ms Gilruth said in response to a question from North East Scotland Conservative MSP Tess White: “It is really important that we look at marginalised groups and their experiences of public transport, because if they are less likely to use public transport we need to encourage them back on to using our railways and buses. It’s really hugely important.”
Responding to West Scotland Labour MSP Katy Clark, she said: “I am live to some of the challenges around the ticket office consultation, particularly in terms of women’s safety.”
Meantime, underlining her ambitions for ScotRail as the Scottish Government prepares to take full control on April 1, Ms Gilruth said: “A successful demand-focused railway has a huge part to play in delivering a truly integrated decarbonised transport system for Scotland.
"But to be truly integrated, rail needs to play a much bigger part in the overall transport system than it does at present.
"We need a sea change on the vision to propel us forward.”