Your voltage divider does give you 2.5V, which the inputs (assuming they are 3.3V CMOS inputs) will interpret as a logic "high". But in the alternate state of the switch in your schematic, the inputs will be open. Depending on your chip, this may result in an undefined state, or may be interpreted as a logic "high" as well.
So in this respect your scheme does not work. You want to switch the inputs between 0V (GND) ad 2.5V. Alternatively, connect a pulldown resistor form each input to GND permanently. That resistor's vaule needs to be significantly higher than the resistors in your voltage divider -- a few kOhm.