A driver at a Pattaya railway crossing tried to speed past a lowering barrier and got stuck, narrowly avoiding a collision with a train.