There are definitely uses and places for the AC/2. Honestly, I find the AC/5 harder to justify on the modern battlefield than the AC/2.
As Isanova says, infantry with AC/2 field guns can lay down a credible threat at a great distance. With 45 shots a ton, they also have extreme combat longevity for field gun infantry.
Kovax also made a great point that in 3025 they were fantastic for immobilizing vehicles before they can reach combat ranges, swatting VTOLs, and forcing a PSR on aircraft. What he didn't mention is that with special ammunition, they're still amongst the best weapons for this role
Precision ammo renders half the normal shots per ton, but that's still 22 shots for an AC/2! An AC/2 loaded with precision ammo can reliably hit any vehicle out to 21 hexes, and can very easily neutralize whole lances of vehicles before they can even get in range for their own weapons! While the LB-2X has around a 40% chance of a second location roll, the AC/2 with precision is more likely to hit in the first place, particularly against annoyingly fast but easy to immobilize units like hovercraft.
Loaded with flak ammo, an AC/2 is still a great way to eliminate VTOLs and force PSRs on aircraft. -2 to hit isn't quite as good as LB-X, but you're not giving up much, and you can carry a ton of flak and a ton of precision to give yourself the perfect tool to deal with any non-'Mech opponent you come across.
Finally, unlike the LB-2X's cluster rounds, the standard AC/2's bonuses for flak and precision ammo stack with that of a targeting computer! Using an AC/2 with precision ammo and a targeting computer to target a breached location can allow you to quickly finish off damaged enemy units at a significant distance, preventing them from escaping.
Honestly, it's the AC/5 that I feel has the harder time being competitive. The AC/2s range and special ammo gives it a lot of utility that can't be matched by other weapons. It's hardly the most impressive weapon, but it certainly has a role to play on the battlefield, albeit a small one. The AC/5, however, only does slightly more damage than the AC/2 but a large number of weapons of similar size have similar or superior range and damage output.