If there is any other approach, please suggest that as well.
In addition to the suggestion of using a Lua script, you could stick to your solution of using INCR
and simulate the reset of the counter on the client side by taking the remainder of the returned value.
Something similar to:
int value = jedis.incr("counter") % 25000;