There are a number of advantages the Golems have over both infantry and vehicles.
The first is that they can wait silent and immobile for a long time, they have no need to breathe or eat. They are also strong and tough, although not as strong or as tough individually as a tank. They would be essentially impervious to most small arms fire, heavier weaponry would be needed to shut them down.
You need to use these advantages rather than trying to engage head-on. Terrorize the enemy, make them dread every step.
This is quite simple, replace some statues with Golems and wait. On a suitable symbol the statues come to life and attack. This gives an instant fear and confusion factor, and with the Golem being in the middle of your troops using heavy weapons on them will cause a lot of collatoral damage.
Streams and rivers allow the Golems to move around undetected and strike from unexpected angles.
Bury a golem into the ground on a street with a big stack of remote-controlled explosives.
It remains quiet and hidden until a vehicle passes over, at that point its arm comes out and attaches a pack of remote-controlled explosives to the vehicle. It then goes quiet again until the next vehicle passes and then repeats the process.
Golem's don't seem to "see" in a conventional sense. They may well be able to operate at full effectiveness even in pitch black or smoke. They could be used for night attacks, or use smoke grenades to obscure vision.
Golem's don't breathe, equip the Golems with dangerous chemicals that produce poison gas, have them throw it and walk through it.
Golem's are fireproof, equip the Golems with flamethrowers and also wrap them in rags soaked in oil that ignites when they set off the flamethrowers.
Underground and fire
Bury golems under likely camping spots for the invasion forces. They would be completely still and silent so essentially undetectable if placed well. At a suitable time in the night they would rise up and find high value stores. They would set light to those stores then bury back underground under the burning supplies and hide themselves under the ashes.
The course of the invasion
It starts immediately as the army advances, strange figures striking in the night and then disappearing again. Soon the men are afraid to go near water as the enemy special forces are lurking in the streams and rivers waiting to attack.
You camp for the night and your supplies go up in flames, but there are no signs of any attackers. Suspicion turns on your own men and the guards on duty that night are shot for dereliction of duty, but the next night the same thing happens again.
As the convoy approaches the town there is no sign of resistance, no enemy fire, but suddenly the leading 6 APCs in the convoy explode from beneath. A thorough search finds no attackers in the area but there are remains of an explosive device found attached to the bottom of each vehicle. Again suspicion turns inwards and paranoia starts to spread. Guards are posted on the remaining vehicles overnight and supply depot guards are doubled.
The next day though despite all these precautions the remaining APCs also explode, again with devices attached underneath.
The remaining demoralized troops sweep into the town to find the area evacuated and no sign of resistance. As they move further into the town though strange hulking figures step out of the buildings around them. The ones in front shoot out vast tongues of flame, igniting into walking nine feet tall figures of flames. From the sides comes more of the figures, these ones throwing gas and smoke grenades. Then the statues in the center of the square come to life and charge towards the leaders of the army, brushing aside fully grown men like they weigh nothing and with bullet fire bouncing off them, barely chipping their surface.
The terrified men panic and turn to run but more of the hellish creatures are rising up out of the ground behind them. The panic turns into a mass stampede and they run for their lives, losing a huge number of men and all of the leaders in the process.
...and that's how 24 Golems defeat an army :)