You could take a bunch of regions where it would be reasonable to build trains, and then you add a bunch of regions where it would not be reasonable to build trains, and count them together. The population density of that combined area tells you very little about whether it is reasonable to build trains somewhere in that area.
I mean, if you had some Californias and some Antarcticas, your decision about whether to build a train between LA and SF within each California should not depend on the number of Antarcticas.