Unlike with some of the other mysteries, you must obtain a specific ending with Marsgate to get the achievement for completing it. It is easily missable, therefore, even if you choose the Marsgate mystery at game setup or have it randomly selected for you.
This solution has spoilers for the mystery.
Like the other Surviving Mars mysteries, Marsgate will trigger after certain conditions are met. Typically, this happens after you reach 100 colonists and one of your RC Explorers scans a specific surface anomaly. You'll be alerted to an unknown object coming in from Earth. For me, this happened on Sol 45.
Skipping ahead a bit, you'll be contacted by EsoCorp to repair one of its experimental vehicles with one of your drones. The message says not to send a rover, but if the broken vehicle is outside your drone hub radius, you'll have to send an RC Commander, and don't worry - it's OK. When the commander is in radius of the vehicle, select the vehicle and repair it. You don't have to manually command your drones; they know what to do.
After that, go about your business. For now, you can repair more broken vehicles for $500M each whenever you see them. Before long, you'll have to send an RC Explorer to scan another broken vehicle.
The first critical juncture will occur next. It is called "The Path Splits," and it came for me in Sol 64. To unlock this achievement, you must not select option 3 or B, to "weather it out." The best choice is the first one, to confront and expose EsoCorp. You can also unlock the achievement via the call their bluff/blackmail path, but it will make your game a little harder because some of your colonists will become renegades. If you decide to weather it out, the mystery won't progress any further. After making this choice, you can continue repairing broken vehicles for money, but be advised, they're going to attack you later if they are working, so maybe just leave them broken.
If you didn't blow the whistle on EsoCorp in the previous event, someone else will, and when all is said and done, you will end up in the same place: the "Trial of the Century." It doesn't matter what you say at the trial.
Some time later, the next critical event occurs: "The Day We Feared." I got this event in Sol 94. When it comes, you will discover a breakthrough, and you'd better move it to the top of your research queue and pursue it immediately. (It only requires 1,000 research points, so by this time, you should be able to knock it out in less than 1 sol.) This would be a good time to make a manual save.
You will need to place defense turrets around your colony. They cost 10 metal and 5 electronics and consume 10 power. Their range is quite a bit larger than the placement tool indicates. How many you need depends entirely on your layout. I happened to be in a compact layout in a corner of the map, so I was able to surround and adequately defend my colony with only 10 turrets. You may need many more.
You will have 3 sols to prepare for the first wave, which includes doing the research and building the turrets. You might also want to lay out a few extra drone hubs. The enemy turrets don't all attack at once. They definitely target your turrets first, so when you see one get destroyed, rebuild it ASAP. You can kiss all of your rovers goodbye.
There's a little time between waves, but not much. The second wave is much more severe. They will not only prioritize your turrets and rovers, but also your accumulators and drone hubs. If you lose power and drone control, you won't be able to keep your turrets operational, your colony will be destroyed, and your game will be over. My advice here is to remember that rockets serve as indestructible drone hubs. Land rockets in various places (this is no time to worry about landing pads!) to keep some drones running no matter what else happens. You'll also need a supply of metal and electronics to repair your destroyed turrets.
Soon after the second wave starts, you'll see an event about using EsoCorp's destroyed rovers against them. Send drones to any destroyed rover you can reach and repair it to put it under your control. This helps loads! I managed to get 10 EsoCorp rovers under my control, and that made the second wave a piece of cake. You can also salvage the destroyed rovers if you need the metal and electronics for your own repairs.
If your colony survives the assault, the achievement will unlock after you respond to a final event telling you how great you did.