WASHINGTON — San Antonio is the seventh-largest city in the United States, a progressive and economically vibrant metropolis of 1.4 million people sprawled across south-central Texas. But the speed of its Internet service is no match for the Latvian capital, Riga, a city of 700,000 on the Baltic Sea.

Riga’s average Internet speed is at least two-and-a-half times that of San Antonio’s, according to Ookla, a research firm that measures broadband speeds around the globe. In other words, downloading a two-hour high-definition movie takes, on average, 35 minutes in San Antonio — and 13 in Riga.

And the cost of Riga’s service is about one-fourth that of San Antonio.

The United States, the country that invented the Internet, is falling dangerously behind in offering high-speed, affordable broadband service to businesses and consumers, according to technology experts and an array of recent studies.

In terms of Internet speed and cost, “ours seems completely out of whack with what we see in the rest of the world,” said Susan Crawford, a law professor at Yeshiva University in Manhattan, a former Obama administration technology adviser and a leading critic of American broadband.