A Swindon man has been sentenced after being found with a knife and a knuckle duster at a train station.