Succinctly put, no, these weapons deal too little damage, making them next to useless in most situations.
While I present this conclusion first, I looked at it impartially until the disparity was overwhelmingly showing how inadequate the facilities performed in actual battles. It may seem a harsh judgement, but I think its fair. With that out of the way, let's first look at their universal advantages in more detail.
- They have a massive threatened area. With up to double the range of their large weapon counterparts and the ability to fire from almost anywhere on a planet. Add the radius of the planet to get the true range of a planetary battery. Only the large Reinforcing Swarm Battery compares. If there's a committed attack on the planet's defenses, these will contribute from beginning to end. This can allow them to do significant damage over time.
- They are difficult to disable. Long after all space defenses have been destroyed, they can weather a decent amount of bombardment and typically need to be destroyed by an earnest ground based attack. This enables them to stay in the fight long enough to do significant damage.
- Does enough damage per shot to be at least somewhat effective against any target they hit.
- Cost no resources aside from $.
Their universal disadvantages.
- They don't focus fire. They'll typically target the closest threat, but not consistently. Being far doesn't seem to mitigate the chances of being a secondary target much, which works against the first advantage. This happens often, somewhere around 1 in 5 to 8 shots target something more distant, and that's not counting what is split between approximately equal distant targets.

- They do poor DPS. The numbers on the info for the weapons are accurate as far as I can tell (no surprise there). Even compared to a typical AI-designed ship, it's not much DPS for the cost. The best in terms of DPS, the Tier 8 Rail Gun, reaches 39 DPS, which is still less than a single Tier 7 large titan blaster. Putting it more into perspective, the hardest hitting facility will struggle to beat the tank of a lone typical Tier 8 cruiser, IF it were standing still. Which brings us to the next problem.
- They have poor accuracy. They don't benefit from a command center, or targeting computers, or ship bonuses. Which means a lone frigate with just 2 Talassos shields and 67% countermeasures can tank a Rail Gun and Beam defense batteries of matching tier combined. Don't take my word for it, see for yourself. Here, at 2755.05.19, I let the defenses chip down the shields of such a frigate before starting to orbit the planet.

About 7 months later, nothing but this frigate being shot at. Shields up.

Its not all bad, though- universal bonuses to accuracy count. After the above moment, I gave the planet's empire 6 military academies, giving it a 60% bonus to targeting. Then kept going in a circle around the planet. 6 months later, at least the shields weren't going up anymore. Still, that's a more than battleship's worth of maintenance in pure weaponry and it isn't able to deal with a single frigate.

Here's the heavy frigate's loadout for the curious. I put 2 repair bots on to deal with possible component damage through armor messing with the test.

- They don't concentrate fire. This means that since they mostly target the nearest thing, it often won't be the target anything else is shooting at. Which means most of their firepower is wasted on a target that will regenerate most or all of what little the weapon can deal to a live target.
- They're expensive in construction and maintenance. Considering the above problems (let alone the inherent limitations of a defensive emplacement), their cost is monstrous. What can be accomplished with 3 generic destroyers in a pure defensive capacity is greater, cheaper, and more effective in all but the worst situations (where, once again, the weapon batteries are nearly ineffective anyway). While they don't cost resources, the $ cost is prohibitive for smaller empires and a hefty cost for large ones to cover multiple colonies. This is arguably the AI's worst expense- in numerous ineffective surface-to-space weapon batteries.
Very badly. The prime reason is fighters. Platforms can not only deliver strong, long range, focused fire, they also have a solid fighter compliment, and on top of that, can have some utility too. Just... look at this run-of-the-mill AI built defense platform. More firepower. Better accuracy. Great range. A carrier's worth of fighters. Much better maintenance. It even has long range sensors and an EMP weapon. And you can build as many as you want! Even if you could build 8 weapons batteries, they wouldn't hold a candle to the firestorm that 8 defense bases deliver.

Okay, okay... wait... there has to be some hidden advantage... right? Well... they're an extra target in a ground invasion.
Seriously, its planetary fighter bases. They don't suffer from any of the downsides of the other planet based weapons. They're even better than defense platforms when it comes to Humans, *Mortalen and Haakonish. In their case, bastions can get 36 fighters with 1.5 build speed, against the fighter base's 72 with 4 build speed. Since a typical bastion runs 1.5-2k in maintenance with savings, the base is usually more cost effective. And that's on top of the base's inherent advantages for being planetside: fighters patrolling around it and superior survivability. The disadvantage being that a colony can only have one, and the other races can have 5 fighter hangers on bastions. A Human/Mortalen/Haakonish bastion could be built bare bones garner a better fighter to $ ratio, but that forgoes the other advantages bastions should have. Discussing why fighters are extraordinary defense weapons is another topic, but suffice to say, they can deliver a lot of DPS and have substantial defensive value.
Okay, back on the planetary weapon batteries- the best part- math.
First, let's generously assume the average planet is 5k in size. All DPS estimations will not include fighters that the compared ships would have. It will also disregard resource costs (not even remotely close to a good trade off). Range will be considered, but remember that ships can jump right into combat in defense. I derive component and ship costs from this cost spreadsheet I made. ... As posted in the War Room. We'll compare the batteries to an ergonomic Light Cruiser, using the following loadout without weapons, typically costing $25,365 with $1,268 maintenance before savings (this ship gets 34% before other bonuses). With Deucalios shields and repair bots, the cruisers regenerate 4.4* shields and repair 1.2* component/hull/armor. We'll use 2 of these as as the baseline ship to mount the weapons on for cost comparison. I considered comparing to a bastion, but 2 cruisers with weapons are closer to the cost of a weapon battery and have a smaller ratio of fighters to cost.

*It appears that regeneration and repair works at a much greater rate than suggested. For example, during these tests, the frigate, with a supposed 1.2 repair rate, instantly ticked 9 armor damage to full at normal game speed with every Rail Gun hit through shields. We'll assume the infocard's suggested rate regardless.
I'll then make estimated damage from the batteries vs the cruisers at 1k distance. With an expected 0% bonus to targeting (+10% from academy) vs 50% countermeasures (also +10% from academy), I guess a 40% hit rate with a 80% point blank accuracy. This seeeeeeems consistent enough with the frigate example shown above, where a +60% bonus to targeting from the academy didn't come anywhere close to negating the frigate's countermeasures.
Now looking at Beam Defense.

The estimated cost of 6 Large Shatterforce Beams on the cruisers are $59k at $2.9k ($1.9k before other bonuses) maintenance, with a combined maximum 38 DPS against 15.8. Cruiser range of 3480 with 52% maximum damage falloff vs 5275 (+2500) with 42% maximum damage falloff.

Phasers cost $70.6k at $3.5k ($2.3k) maintenance, with 71.3 DPS against 22.9. Range of 2750 with 41% falloff vs 6380 (+2500) with 51% falloff.
The v2 beams can be expected to effectively deliver, on a single hit at 1k distance, 34 damage to shields, 1 to armor and 1.2 to components/structure. With a 40% hit rate and splitting 6/7 of the shots between the two (1/7 as a 'wasted shot' against a further target), the v2 beams effectively does ~2.5 DPS against the shields of the two cruisers with negligible armor and component/hull damage, which they have no trouble tanking indefinitely.
Now looking at Torpedo defense.

The cruisers can only mount 4 L Shockwaves with 38 extra space. They cost $63.5k at $3.2k ($2.1k) maintenance. Max DPS: 38.4 vs 18. Range: 4350 with 87% falloff vs 7500 (+2500) with 75% falloff.

4 L Quantum Shards: $67.6k at $3.4k ($2.2k) maintenance. Max DPS: 47.4 vs 29.3. Range: 5000 with 75% falloff vs 9000 (+2500) with 90% falloff.
The Planetary Torpedo Launcher v2 will deal 31.6 damage to shields on a hit without PD. It will deliver an average of ~2.5 DPS (((31.6)/'max damage')*'max DPS'*(3/7 shots each)*'~0.4 chance to hit') to each cruiser's shields, also effortlessly tanked.
Now... Missiles. One of the crew quarters gets scrapped to accommodate, but this only reduces the cruiser's resistance to boarding.

4 L Lance Missiles v2 + 2 M Lance Missiles v1. Cost: $56k, $2.8k ($1.9k) maintenance. DPS: 14.4 vs 7.2. Range: 3850/2570 with 0% falloff vs 7020 (+2500) with 0% falloff.

2 Hunter Missiles v1 + 2 L Lance Missiles v3. Cost: $60k, $3k ($2k) maintenance. DPS: 12.2 vs 8.6 (yes, the Hunter is a downgrade in DPS due to its size). Range: 5700/4620 with 0% falloff vs 11850 (+2500) with 0% falloff.
- *Comparing the Planetary Missile Battery v3 is tricky. Reinforcing Swarms require significantly more research, and the v2 Hunter is only a small upgrade to v1. Any way its cut, it still gets more DPS, but in this case I'll demonstrate the Tier 9 equivalent since tier 7 is about the same as the above with a Lance.

4 L Reinforcing Swarms, cost: $71k, $3.5k ($2.3k) maintenance. DPS: 55.84 vs 10.6. Range: 8200 vs 20000 (+2500).
The Planetary Missile Battery v3 nets 13.5 damage on shields and 0 against armor. This gives it 0 DPS to armor, and ~1.7 DPS vs shields of the cruisers. Even more easily tanked than the others.
- The missile group is the extreme example of why defense batteries fail. They overemphasize threatened area. The spreading of shots gets more exacerbated due to the enormous range. They do far too little damage when they do hit. The one real positive of missile batteries is their targeting bonus combined with a high base chance to hit (especially at extreme range), but it doesn't come close to making up for the damage deficit that even feels the resistance of shields significantly.

6 Heavy Rail Guns. Cost: $58k, $2.9k ($1.9k) maintenance. DPS: 44.6 vs 19.2. Range: 1680 with 16.8% falloff vs 2800 (+2500) with 14% falloff.

4 L Forge Rail Battery v1. Cost: $66.5k, $3.3k ($2.2k) maintenance. DPS: 38.4 vs 27.6. Range: 2700 with 0% falloff vs 3390 (+2500) with 17% falloff.

4 L Forge Rail Battery v2. Cost: $66.5k, $3.3k ($2.2k) maintenance. DPS: 56.3 vs 39. Range: 3270 with 0% falloff vs 4110 (+2500) with 21% falloff.
The Planetary Cannon Battery v3, again at 1k range, delivers 27.9 damage to shields, 16.7 to armor. Divided between targets and accounting for accuracy, comes to 2.5 DPS vs shields and 1.5 vs armor. Juuust barely enough to threaten the cruisers given time, when considering the Deucalios' 3% chance for 10% shield penetration. If they could stay on target for at least one of them... but they don't.
What if we combined ALL the facilities (aside from that blue-on-blue fighter-killing AoE group) in one? That's 9.2 DPS combined against two and a half target's shields, with barely enough to scratch inferior armor through ergonomic shields, for 10k of maintenance! In case it was missed, that's objectively terrible. These weapons are, straight up, ineffective in battle. They might deter a transport or two, but otherwise, they're a abhorrent waste of the AI's resources.
So, how can Surface-to-Space weapons be redeemed?
Let's discuss. Or refute/support any of all that. I certainly didn't cover every consideration, though I think this covered the big things: lack of firepower, lack of concentrated fire on the target of allies, and lack of focusing on a target.
One idea already implemented in a personal modification is to drastically reduce the cost of planetary batteries along with troop costs. Perhaps we can hear more about that

