They mentioned this exact scenario on their website[1]
> Of course, if you happen to be with a friend who has an AirTag, or on a train with a whole bunch of people with AirTag, don’t worry. These alerts are triggered only when an AirTag is separated from its owner.