I would prefer to have traveled by train.
I would have preferred to travel by train.
My textbook says that these sentences have the same meaning. But I have a feeling that the first sentence shows that you have a preference now. And in the second sentence you had a preference before.
For example I took the plane yesterday and it was my intention (I didn't want to take the train). But today I find out that something interesting happened on the train (they served free deserts). And I say: "I would prefer to have traveled by train." I cannot use the second sentence, because it implies I wanted to take the train yesterday, but somehow took the plane.