The issue is caused by either a damaged or missing smart cover sensor which is generally behind on the glass itself.
This is just a guess but it could be that the sensor got damaged when the iPad was serviced.
Or the digitizer glass was damaged during the replacement and the digitizer glass was replaced with one that does not have the smart cover sensor on them.
Now if you do not have a smart cover or intend to use one you should be able to disable the smart cover locking in the iPad settings to allow you the power button to work properly instead of getting it fixed.
I recommend taking it back to where you got the battery replaced from and get them to fix it.