A chunk of open former railway land on the outskirts of an East Lancashire town centre is to be transformed into 40 affordable homes.