Train or taxi from the airport? It comes down to four things: cost, time, how many of you there are, and how much you are carrying.
Cost
An airport express is almost always cheaper per person, often dramatically so. A taxi's cost is fixed per car, so it improves the more people share it.
Time
A dedicated express has a fixed journey time and skips traffic; a taxi can be faster off-peak but unpredictable at rush hour.
Group size & luggage
Solo or a couple with light bags: the train usually wins. A group of three or four, or heavy luggage: a shared taxi closes the gap and is easier door-to-door.
Rule of thumb
One or two travellers, take the train. Three or four with bags, or a late-night arrival, take a taxi. Each city is different, so check the specific numbers in that city's guide — for example, Delhi Airport Express vs taxi. See also express vs metro.