A U.S. federal judge ruled Thursday that drugmakers Sanofi SA and partner Regeneron Pharmaceuticals Inc. infringed the patent that rival Amgen Inc. holds for its new cholesterol drug.

The decision permanently blocks Sanofi and Regeneron from selling their drug Praluent in the U.S., which would provide a big boost to Amgen’s drug Repatha if the decision stands.

Both...