Lest people get the wrong impression, my position in this matter is not absolute at all. Yes I value my privacy and other rights. OTOH I do realize that there are genuine risks that need to be mitigated and some of it might include certain intrusions into my rights in specific situations. For example, I cannot imagine flying safely without going through some sort of vetting to determine that I will not do something undesirable while flying. The mitigation though has to be proportional to the risk and acts involved must be carried out professionally. Furthermore the purported acts of mitigation should not be used for purposes other than the risk being mitigated. This is where the whole TSA exercise looks questionable to me, not that I and others are vetted before getting on a commercial plane.
As for trains, the nature of risks is different. The attack vectors in case of trains are primarily in the form of attack on ROW. For each on board bomb attack in the wold on a train there have been ten or more tampering with track either by accident or deliberately, causing mayhem. So the value of pre-boarding vetting is low, and therefore should be carried out much less intrusively. Indeed, as the events in Brussels Airport show, the greater risk is at the station than aboard the vehicle, since the stations really are much softer targets. How you protect them is quite a challenge. Sniffing and poking only those that are boarding a small subset of trains is mitigating a lesser risk.
Countries where the risk profile is greater do actually keep themselves prepared to search and check everyone entering a station premise. Usually these are not actively carried out until the risk level is determined to be high enough to require such, based on other intelligence. In big cities in India when risk levels are determined to be high enough, you do have to walk through a magnetometer, be patted down and have all bags opened and searched when you enter a mall or a cinema house, or a hotel (specially western chains ones) even, in addition to Metro Stations and even Main Line stations. If the risk is real it needs to be mitigated and one has to decide what is the right tradeoff between privacy right and the right to continue to live unharmed. There is no simple, single or easy answer to this conundrum. It has to be handled almost case by case.