A lot of the construction is on land that is already owned by the railways. When the original lines were built during the days of the Raj, the railways were given very wide swaths of land. Currently the railways in many places lease out the land for farming, but the ownership still lies with the railways. In general for significant stretches along what used to be the EIR (East Indian Railway) ROW there is enough space to build not only a double track DFC, but eventually even to build a double track HSR should the need arise. Though I suspect an HSR would not follow the twisty turny classical ROW in many place but be built as a continuous high elevated structure across farmlands with relatively low environmental impact.
Where such is not the case it usually takes many years of eminent domain type litigation before the land can be acquired, often after political intervention, legislation and what not. Sometimes even that fails, like happened for the Kolkata to Dum Dum (Netaji Subhash Chandra Bose International) Airport VIP (Kazi Nazrul Islam) road, which has left a big jog in the road and the elevated structure being built for the expressway above it. The East West Metro construction in Kolkata is held up at its western end due to the government's inability or lack of desire to evict squatters from land that is owned by the state government. Such odd things happen all the time.
However, in case of the DFCs they do not get into urban territory too much, and it is usually easier to negotiate rural land in exchange for promise of job in the railways or other infrastructure maintenance and operations and such. The Kolkata end of it for example ends in Dankuni way outside the urban area, in a huge multi-modal transfer facility. The Delhi end skirts the Delhi urban area to the east and north, to continue onto the north.