As far as I know こと doesn't really have a translation in such sentences. But there is something lost here as the sentence would work with and without the こと. The difference would be the emphasis and range.
A good explanation about range can be found in this answer by Ento.
Without the こと you are talking specifically and only about the 「アキバからの帰り道」- the way home from Akihabara. With the こと you are talking about the whole experience of the way home from Akihabara - the train station, the tracks, the view, the walkways and everything that comes along.
So without the こと that might imply that whatever it was, it was RIGHT on your way home from Akihabara but with こと the implication is that it was SOMEWHERE in the vicinity of your way home from Akihabara. This notion is usually lost in translation.
You could force the English translation to reflect that by saying:
"It was somewhere in the vicinity of the way home from Akibahara" but that is somewhat unnatural and cumbersome in English.
There is this video by Cure Dolly that might help (Disclaimer: Haven't seen it yet as I'm following the lessons mostly chronologically) but generally her explanations are very logical and well explained.
Hope this helps!