To enrich the experience, it seems that land crossing is dealt on a case-by-case basis.
Riding Amtrak from Montreal to New York (Adirondack train), it all began at the Montreal central station when personnel was giving away entry application forms (huge ones, A4-paper-sized) to passengers in line in front of the stairs leading to the platform. I was asked if I had an ESTA, as it was the case, no form was given to me.
The first stop of that train is in USA; just one hour on the rails led us to the border crossing, where US officers boarded the train and checked passengers at their seats. For cases requiring more examination, passengers were asked to go to the "café" car where all the forms were available. I had to fill a green form that was typically given in airports 10-15 years ago, and a stub was stapled in my passport; all clear.
Last thing was to pay the 6 USD fee applicable to land entries. The little detail is that officers only take US dollars, no cards; the bar attendant at the café car is able to do the currency exchange with Canadian dollars.
The customs stop lasted 1 hour. The train reached New York in time.
Seems the train is a rather relaxed way to cross the border; passengers remain at their seats. By bus, passengers need to get off with their luggage at the border checkpoint, clear the immigration, then get back on board.