Hidden $U(1)$ gauge symmetry realizing a neutrinophilic two-Higgs-doublet model with dark matter