Floods in southern Thailand and northern Malaysia have left thousands stranded.