Do you like travelling by train?
As a child, I liked to travel by train.
As a child, I used to like traveling by train
When I was a child, I loved to travel by train
I don't think your sentence is incorrect but somehow it sounded incomplete. I just give alternatives. ;)
Ok....thank you, Geoffroy.
Another alternative would be:
When I was a child I liked travelling by train.
In my childhood I liked to travel by train.
In my childhood I liked travelling by train.
In my childhood I liked traveling by train.
Very good, Vera!