The vast majority of law-school graduates carry debt loads that exceed their initial earnings, new federal data shows, the latest sign a law degree isn’t a sure path to immediate financial success.

Median earnings a year after graduation topped the federal-loan figure for graduates from just 11 of about 200 law schools for which the U.S. Department of Education released data. The favorable ratios were largely for elite private institutions—including Cornell University, the University of Pennsylvania, Yale University, Northwestern...