Fannie and Freddie are demanding higher returns from lenders in exchange for buying loans that help finance rental-apartment buildings, as the two mortgage-finance giants expand in the sector.