Donald J. Trump and his partners won control of the bankrupt casino company Trump Entertainment Resorts Inc., when a judge ruled today that their bid was better for creditors than a competing offer by investor Carl Icahn.