Shornecliffe Station is more than 100 years old, prompting Queensland Rail to bring in archaeologists to analyse the site during extensive renovations.
The hat, confirmed to have belonged to a Navy sailor, was among the finds.
A historian then assisted Queensland Rail in finding the cap’s owner, who was later confirmed to be Ernest Hodgess, who has since died.
The hat was then returned to Mr Hodgess’ family, who were brought to tears at the return of the heirloom.
Jamie Hodgess, Ernest’s son, is a retired sailor, the second in three generations to serve in the Australian Defence Force.
“It’s amazing because inside my cap is ‘Hodgess JM’,” Jamie said.
“To see his name, ‘Hodgess EJ’, inside the cap is just unbelievable.
“It’s our dad’s cap and it’s amazing they’ve returned it to us. He was a great man.”
Stuart Hodgess, Ernest’s grandson, is also in defence, serving as an army officer.
“It’s pretty amazing, to be honest,” Stuart said.
Ernest served in the Navy for 10 years, working aboard the HMAS Warrnambool off the coast of Cairns, clearing mines.
In 1947, the ship hit a mine, injuring Ernest and killing three others.
“There was an explosion, it took a lot of water and he was critically injured,” Jamie said of his father’s injury.
The incident helped historian Jacqui Donegan piece together the information required to locate the cap’s owner.
“I knew it was a name with seven letters, it started with an H and ended with an S and most likely had vowels in the middle,” Ms Donegan said.
“I looked up Hodgess with a double S and saw the article on the Warnambool and knew straight away I had my man.”
Ms Donegan said the process of guessing Mr Hodgess’ name and searching for him in Trove, the National Library of Australia’s database, took only 15 minutes.
“It’s incredibly gratifying. It’s something quite straightforward for me but I know it means incredible happiness for the recipients. I was very determined, and I am quite forensic,” she said.
Xavier Carah, a senior heritage consultant from Niche Environment and Heritage, said the sailor’s cap was discovered during renovations under a trapdoor that had been covered in carpet.
“Naturally you open the trapdoor. Just there on the surface was the Royal Australian Navy cap,” Mr Carah said.
He added the cap was in fantastic condition, faring well under the train station after 70 years.
“It’s a really great outcome and it’s great to see the heartfelt emotion this has brought up for the Hodgess family.”
It’s not understood how the cap ended up at the station’s ticket office, but Ernest Hodgess did go to the station on shore leave, visiting the woman who would become his wife.
“This is where they met up and then departed each day, and I guess one day he just forgot to put it back on and lost his cap,” said Jamie.