A federal bankruptcy judge ordered a division of the Royal Bank of Canada this week to pay about $45 million in damages for undervaluing assets it seized from a now-defunct real estate firm in the 2007 housing collapse that fueled the recession. Judge George L. Russell found that RBC Capital Markets LLC extended credit to Thornburg Mortgage Inc. in 2007 based on a bid for the company's mortgage-backed securities that was lower than RBC's internal valuation when it had declared Thornburg in default several days earlier.