Put some longbow men almost right in front of the gate and then put Stakes in the ground so when the Mongols had breached your gates they stormed in and crush to the stakes with your longbows pouring arrows on them.
Gunpowder makes the Mongol armies obsolete. For artillery point them at approximately the middle of the enemy formation. Do not using flaming shot as it makes things too inaccurate. For regular gunpowder units like musketeers, simply have them stand in the front ranks and fire at will or target them at Mongol Heavy Cavalry or Horse Archer units. The musket fire will do a fair amount of damage, they will also decrease the morale of the enemy troops significantly. Make sure you stop your gunpowder units from firing into the backs of your own troops though as that will cause them morale penalties as well. After the initial contact, simply use your musketeers to target either the very back ranks of the enemy or use them as a last ditch effort to hold the line while you flanking the enemies.
If the Mongols bring siege engines, move your archers off the walls directly in front of them and have them shoot from a distance. Fill the holes in your line with your spearmen and watch the slaughter. Get upgraded towers as soon as possible to increase the carnage.
Playing Open Battle
In Medieval II total war do not face the Mongol in plain terrain. Pick rough terrains with trees, hills and mountains. Place your archers and infantry in wooded areas and mountainous ones, this is much more effective against Mongol cavalry.
Put your archers in first line and your foot troops behind them. Turn your archers skirmish mode off. Put horse archers on one flank and your ballista on other flank. Set your ballista to fire at will mode. If you have a lot of horse archer, you can put them on both flanks. Put your cavalry on the flank but slightly behind your horse archer.
Firstly they will attack you with come horse archers. They will do lots of fake charges and will die under a sea of arrows from your archers on higher ground and your flanking horse archer. Wait for the rest of the horde. Do not enter melee combat until you have killed a lot of enemies. When you have killed enough of their army, charge with all your cavalry on units on one side of their line. Use our horse archers to chase routers. After destroy one unit, reform your heavy cavalry and routs next unit.
In field battle beware of flanking cavalry. Try and have a good general with your army and when engaging theirs, always attack and try and kill their general first. If you can kill off that general, the resulting morale loss will help you win the battle.
Other Way To Defeat the Mongol
In Medieval II Total War not every victory should be achieved by a battle. May be you have not enough money to fight the Mongol in field battle, or may be you do not have decent defense at your cities. If you want to avoid fighting, give them a crappy settlement and that way no more hordes will come because they have a new home. Try to form an alliance if possible, as they can be powerful allies. You could also try assassinating their leaders and the hordes will disband. But do not kill the grand Khan with an assassin because more armies will come.