There are more issues at play here. Chainstay clearance for one. Even at a 50mm chainline, standard for most XC MTBs, a road triple's middle chainring would not clear the chain stays on most MTBs even if the crankarms do which is another problem.
You might be able to get a long enough BB spindle to get clearance, but you will sacrifice chainline to do it.
I'm speaking in generalities here. Your particular bike might work, but I wouldn't bet the farm on it.