US debt crossed a record $40 trillion as rising interest costs and surging Treasury yields put growing pressure on government finances.