Heated spear with internal electric motor vibrator fired from rail gun at close range in an urban environment...
Lets take each part of this idea, one by one
Heated - warmer materials almost always are weaker. If this monster shell has any armor, heating the spear will make it not penetrate the armor.
Electric motor - it requires cold material, below the curie point for magnetic core to work
Vibrator - requires a battery, and battery energy storage is much worse than an explosive.
Rail gun - designed to accelerate short projectiles. As projectile becomes longer, output speed reduces. Also it acceleration is extreme and will smash all the electronic and mechanic inside. Especially if it is hot.
Close range - railgun requires stupidly large power supply and rail itself is heavy. It is all so big that at close range even a hedgehog speed is enough to avoid it. It is too cumbersome to use railgun in close range. At whatever tech level, other uses will be preferred.
Urban - requires maneuverability for quick delivery, and more importantly cheap price to have thousands of ready installation all over the city for even quicker delivery time. Your contraption fails at both. Too slow. Too expensive to make thousands of it.
So, what would i change?
Use room temperature material for better strength and penetration.
Use short projectile for higher speed for more penetration and damage and cheaper weapon that can be made in many units and be easier to deliver.
Use no electronic or mechanic parts inside because they will be smashed by the firing acceleration.
Use explosive as energy storage rather than a battery, because explosive can do more work in total than a battery. Even if this work is cutting. If collateral damage is an issue, use low explosives like a gunpowder, that still rips stuff apart, also dont use cerrated metal shell to avoid shrapnel. So, a copper shell with low explosives, gunpowder that explodes after it is inside the monster. No collateral damage this way, not even windows will be damaged.
Use a short barrel with gunpowder prolellant for ease of maneuvers in urban environment, ease of movement so to not to carry 1000 tons power supply for a rail gun, because 1 ton gun will do just as well.
How to deal with regeneration? Just keep in mind that 1 kg of regenerated flesh needs 10 of of food. So to kill a monster you only need to turn 10% of it body mass to a mush. Thats exactly what modern weapon does. 1 shot of a rifle with 10g projectile turns about 1 kg of flesh into a red soup. Even better ratio for a sniper rifle, with many kg of flesh completely destroyed. A bear weighs about 1 ton, and 100 kg of his flesh needs to be destroyed for his regeneration to be irrelevant. Several shots of a sniper rifle will do the work. If a single shot is required, then anti aircraft guns have about the right amount of power. Tank shot is overkill, but will also do the work. Also aircraft and tank shells have an option to have explosives inside of them. Some minor changes to remove cerration and use softer metal for the shell to avoid shrapnel will help. For a single person a hand held rocket launcher will do the work. Especially the tandem shaped charge with a delay on the second stage. For first stage to open the armor of the beast, and second stage to enter deeper before exploding. Shaped charge armor penetrating ability is better than that of a railgun. And tandem shaped charge are nothing new today, and for sure will exist in the future as well.