As lopburi3 said, and Wikipedia confirms, in Thailand (as in many countries) the naval rank of captain is the equivalent of the army rank of colonel, one step below flag rank.
Since we are Asean Now, I can relate what I heard when I first went to work in Malaysia last century was that their naval ranks used the same nomenclature as the army, so then a naval captain was the rank between lieutenant and major. This came to an end after a Malaysian naval captain went on an official mission to England and was greeted at on arrival, as was appropriate by military custom, by a British naval captain. Shock, horror! Red faces all around. Malaysia adopted the more "normal" naval ranking system thereafter.