Heavy rainfall in southern Thailand has caused flooding that left thousands stranded and at least 33 people dead.