In touristic places, it is a scam.
The best thing to do is to do not stop. I didn't know they could pickpocket but I am not surprised.
Most of the time, when it comes to 'real' petitions or charities, they have a badge or a jacket, something you can recognize.
Also, be carefull at train stations. Some people are trying to sell you directly tickets, avoiding vending machines or desks. But they are at least twice more expensive and most of the times not valid for your journey.