Lawyers said it was the longest sentence yet for violating Thailand’s notoriously harsh lèse-majesté law.