Inmates burnt down two buildings at a southern Thai jail during a six-hour riot that left three prisoners dead and several officials injured, authorities said on Saturday.