Discrepancy between the measured value and the Standard Model prediction of the muon anomalous magnetic moment is a possible hint for new physics. A \(Z^\prime\) particle with \(\mu\tau\) flavor violating couplings can give a large contribution to the muon anomalous magnetic moment due to the \(\tau\) mass enhancement at the one-loop level, and is known to explain the above discrepancy. In this paper, we study the potential of the Large Hadron Collider (LHC) for detecting such a \(Z^\prime\) boson via the \(p p \to\mu^-\mu^-\tau^+\tau^+ \) process. Earlier studies in the literature only considered the production channel with quark initial states (\(p p \to q \bar q \to\mu^-\mu^-\tau^+\tau^+ \)). Here, we show that the photon initiated process, \(p p \to \gamma \gamma \to \mu^-\mu^-\tau^+\tau^+ \), is in fact the dominant production mode, for a heavy \(Z^\prime\) boson of mass greater than a few hundred GeV. The potential of the high luminosity (HL) LHC is also considered.