Cosmic inflation and $(g-2)_\mu$ in minimal gauged $L_\mu-L_\tau$ model