On a large number of stations the tickets are only sold using electronic vending machines that do not accept cash.
But having my person scanned or groped or fingered is another matter entirely. And it does violate the fourth amendment which protects us from warrantless searches.
It's true that it's all pieced together out of snapshots that would individually be unobjectionable (someone taking a photo of me in a public place), but the end result seems rather different. If a private party attempted to do it, we'd normally consider it a form of harassment, and it'd be illegal in a lot of jurisdictions. You can photograph someone in a public area, but you can't hire an army of photographers to photograph them all around town as they go about their daily routine and plot their movements on a map, because that'd be weird/objectionable.
Could you please elaborate? You don't have to show your ID or to be checked to board a train/bus.
The police are present at railway/bus stations, but I think it's the case in any other country in the world.