Trilhando comes from the verb trilhar, meaning to tread, to follow a path, or to pave a way. It's a more evocative word than simply 'walking' or 'going'.
In the song, the lyric "Trilhando caminhos, entrei em espinhos" (Treading paths, I entered thorns) uses trilhando to paint a picture of the singer actively navigating life's journey, which unfortunately led him into difficult situations. It highlights the deliberate, yet sometimes misguided, nature of his choices.