Yep, and I've lived in both Countries and crossed the border hundreds of times.
In my expierience( and I've done it by auto,bus,ferry,plane and train)it seems that when you're coming back on a train is when the American officials are the rudest and most petty, especially in Niagara Falls,NY.
In crossing into the US by train at various points, which I have done dozens of times, the main annoyance has been the amount of mindless silly questions that are asked. I am sure they serve some purpose somehow.
I find that the treatment at the Niagara Falls checkpoint has improved markedly after they moved to the new station, at least in my experience. maybe the quality of accommodation has an effect on how cranky they are. I could sympathize with that
I watched a great film called "Blinded by the Light", a story about a British born Indian guy who becomes hooked on Bruce Springsteen music... Despite family cultural resistance, he eventually flies to America to see a live concert. The border agent asks him the purpose of his visit and the guy replies "To see the Bruce Springsteen concert"... The agent says "I can't think of a better reason to come, welcome to the USA!"
It's a film, but maybe worth a try next time?
Well, US being home they usually ask me what were you doing in <fill in wherever I am returning from>. Usually the answer is visiting family or riding trains. The latter always elicits further questions which leads to usually a nice short conversation. Of course these days this happens only when crossing back from Canada, since while arriving by air I don't get to meet a human being.
Which reminds me, I have to figure out how to get a renewal interview for Global Entry after I finish getting my vaccination. I apparently have till September to complete that.
While entering Canada or UK I always say "to ride trains". The Canadians look at me like I have grown four heads. In UK they ask me whereabout I am planning to ride. When I tell them something like "the Heart of Wales" line they often mention something that I ought to visit. Those agents are often remarkably knowledgeable about riding trains in the UK.