Cost wise, it's probably cheapest way. Problem if you use bullets, you will be in range of enemy bullets. UAV's can also drop bombs, but they tend to miss, and hit unintended targets
Fun fact, on average in Afghanistan US soldiers fired 250,000 bullets from small arms per one kill, in money it's about 100,000$. Total cost per one kill in Afghanistan was 10-50 millions USD, but ofc it's a bit misleading, killing Talibans wasn't only thing US was doing in Afghanistan. War isn't cheap.
Problem is, rail guns are extremely heavy and takes a lot of power. Now and in foreseeable future they cannot be mounted on anything smaller than a ship.
Remember the movie Independence Day? Those giant alien crafts that were hovering over cities used railguns right? It was able to destroy cities like a meteor impact. If it would have been a laser, it would've gone straight through Earth's crust.
I was thinking of something like that on an aircraft. It will probably be years before something like that is made.
Old Japanese Proverb: When three women get together, it is noisy.