The question is a bit misleading.
I am aware that the Soviets and Germans used armoured trains the most during the war. Their most common tasks were the following:
What I don't get are the actual tactics employed:
Furthermore, it's firing range is limited and it takes quite a lot of luck for the fighting to be close enough to the tracks that the train can actually provide useful support, but not too close that the enemy can just throw grenades at the train or destroy it with artillery support.
There is also the fact that there will probably be a lot of obstacles auch as trees and buildings near the rail line obscuring the firing line.
What purpose does a mobile anti-aircraft battery on train tracks serve? If a town is in danger of air attacks, just put static AA guns in it. If it isn't, well, you don't need the train then. Its very unlikely that the threat status of a town would switch from "safe from air attack" to "unsafe from air attack" in such a short time that the only option is to quickly deploy an armoured train with anti-aircraft guns to the town.
How exactly would a train provide anti-partisan support? There were way too few armoured trains to have one every 20km. So the armoured train may be 100km away from where the partisan attack is currently happening. Until the train arrives to fend them off, they will be long gone.
Besides, the partisans could just easily blow a part of the track in advance so that the train can't proceed to that area anyway.
If this is a show of force thing to dissuade partisans from attacking the rail line, well, see above. The partisans just wait until the train is gone and attack.
So yeah, how did the actual tactics look like? I am aware of how they were used strategically, but I can't wrap my head around how this would translate to actually useful tactics. Also, were they at all effective? With hindsight, should they have been built or not?
A bit more than just WWII, but this should be of interest for you.