TDP or Thermal Design Power is the maximum amount of power dissipated by a component or system. That a CPU has 17W TDP means that it will not under any normal operating circumstances dissipate more than 17W of power as heat.
Since (somewhat simplified) all power used by electrical components eventually becomes heat and no electrical component can create heat without using some amount of power (meaning heat dissipation and power consumption can be considered as equivalent for our purposes), two components with the same rated TDP will have the same maximum input power requirement. However, the normal or average power, especially in a given situation, may be lower for one of them.
For example, you may be able to step down the frequency of the faster CPU more than you can step down the frequency of the slower CPU while retaining the user experience you want. In that case, the faster CPU may actually consume less power for the same user experience.