Sufficient space for a ghast is a 5x5x5 cube.
Source
Notch: they should require 5*5*5 meters, but I haven't double checked it. They might spawn in 4*4*4
(Presumably in the time between Alpha 1.2 and the current version, Beta 1.6, Ghasts now definitely behave as originally intended)
Ghasts do not spawn in the normal world, despite Notch's earlier intentions.
Source (jeb)
Since version 1.5, this hasn't been much of an issue, as that release introduced a rule in the mobs' AI to avoid rails unless they are chasing after the player. Although I have still found Zombie Pigmen appearing on the tracks, this is now not as much of an issue as it was in previous versions.
Zombie Pigmen are able to spawn on rail tracks, so removing the walking path on the side will do nothing. But as has been mentioned, adding blocks above your tracks will prevent them from spawning and help keep them from walking onto your tracks 100% of the time. This is a common "fix", and has been around for quite a while, and it doesn't seem like the developers have any plans to stop this fix from being possible.
The following blocks can safely be placed above the tracks, and will not suffocate you:
- Glass panes (I would really recommend this one, since they are "cheaper" than glass blocks, works with stained glass panes as well)
- Glass blocks (works with stained glass as well)
- Glowstone blocks
- Leaf blocks
- Iron bars
- Fences (of all materials)
- Half-slabs (of all materials, note that they must be single, NOT double slabs)
- Stairs (of all materials)
- Trap doors
- Pistons (both extended and retracted)
There are other blocks that would work, such as Beds, Chests, TNT, or Enchantment Tables, but I have excluded them from the list due to being impractical.
Best Answer
One of the most easy ways to make an Enderman get into a minecart is like so:
Fist you want to put on a pumpkin in place of a helmet. This will make so the Enderman don't run away. This or try your best to look at their feet.
After this surround the Enderman in rails then minecarts. They may get in them themselves or they may need a little persuading. By hitting them they will (Might) jump into the minecarts and therefor be caught. I found that they get caught more often when they walk in theselves.