BANGKOK — The Thai military seized control of the country on Thursday and detained at least 25 leading politicians in a culmination of months of maneuvering by the Bangkok establishment to sideline a populist movement that has won every national election since 2001.