A bandit is a robber, thief, or outlaw. If you cover your face with a bandanna, jump on your horse, and rob the passengers on a train, you're a bandit.
A bandit typically belongs to a gang of bandits who commit crimes in remote, lawless, or out-of-the-way places. A bus traveling through an isolated location that's not policed might be at risk for being attacked by bandits. The word bandit comes from the Italian bandito, "outlaw," from the Vulgar Latin bannire, "to proclaim or proscribe," by way of a Germanic root that's shared by ban.