When you acquire a mortgaged property through a trade or sale, you have two immediate options regarding the mortgage:
You cannot collect rent on any mortgaged property, even if you just purchased it.
Owning a mortgaged property still counts toward completing a color group. You can still collect double rent on the unmortgaged properties in that set.