Your cost today is $50,000$ and your inflows in the future are $10,000$ in savings, minus $500$ in maintenance cost, so in total $9,500$ of inflow. However money today is more valuable than money tomorrow, and this is captured by the interest rate lets suppose the interest rate is $r^*$ (typically given annually) so let's transform it into a monthly rate $r=r^*/12$, then the payback period is the amount of periods $t$ (here everything will be monthly, so $t$ months) such that the present value of the cost equal the present value of the inflows in the future:
Clearly, to solve for $t$ you need to know $r$. The solution is probably pretty close to 5.3 months since monthly interest rates are usually very low and assuming $r=0$ you get that result. (of course the formula does not work for $r=0$, but as mentioned before, in that case $t=50,000/9,500$).