Can the button still work if being far away from Pull-Up Resistor?
Assuming you have a common ground across the length of cable, the pull-up resistor should be placed on the far end as termination.  Depending on the resistance(length) of the cable and the voltage levels, a significantly low value pull-up resistor could possibly keep the controller from detecting a low signal, but that is unlikely unless you are using a resistor of 1K or less, and those low values would be bad design anyhow.

As also suggested in the comments, you should have a small capacitor in place to lower transition jitter...