I had my phone and iPad searched on my first trip to Montreal years and years ago. I am American.
However, it's obvious why I was pulled aside. There were about 80 people in the crowd. About 6 people got "randomly" pulled aside for further inspection. All 6 of us were not white. This was on the train.
I've taken Amtrak a total of 4 times. I've gotten harassed every single time, 4/4.
I've flown into Montreal at least 30-40 times, and only got extra screening once, but they only held me for 3-4 minutes with some extra questions. Smooth sailing.
Never driven into Montreal.
My advice is to never take that damn train.
Is this in regards to CBSA and CBP doing the searching? Sounds like CBSA. In which case, if you are not Canadian, the bar for CBSA to search your device would likely be lower than a Canadian traveler if they suspect you are going to work without authorization.
If CBP, I don't think them having information hours in advance matters.
SecureFlight is already transmitted 72 hours (well in advance of any rail travel) prior to scheduled departure to DHS. Only information APIS contains not in SecureFlight is travel document.
APIS requirement is voluntary for Amtrak but Amtrak does participate. Requirement is to transmit APIS no less than 60 minutes prior to departure of last US station leaving US or last foreign station before entering US. For airlines, the window is lessen to 30 minutes prior to departure.
SecureFlight and APIS is cross referenced against various databases. Having this information hours in advanced doesn't change if there is a match in these databases.