This is very nuanced, it is unlikely you are going to Stirling to London/South of England in an electric car let alone 100 people driving that far in an EV, most people would almost certainly on current tech use petrol or hybrid if driving and therefore a diesel train is more environmentally friendly provided enough people are on it.
Having said that, the railways need electrification to ensure that continue being the green option - particularly on local routes as you rightly say if just looking at day to day CO2 emissions the it becomes less attractive on diesel trains, other factors do need to take into account like 100 extra cars an hour om a road with break dust/ tire particles etc. make trains still an attractive opinion and is the only method of transport that moves large numbers of people efficiently and effectively.
What is ‘nuanced’ today won’t be nuanced tomorrow. Don’t start on the brake dust argument-EVs have regenerative braking just like modern trains so this is a tiny fraction of the pollution produced.
It's all well and good comparing rail with EVs if the overwhelming majority of vehicles on the roads were EVs. But they're not. I don't know how a 22x compares, per passenger, with a mid-10s ICE car with 2 passengers - I wouldn't be surprised if it was still worse - but that that would certainly be a fairer comparison.
According to the government data (linked to below) a 2015 car (mid 2010s) was around 122-125g CO2 per km. The diesel 220/221/222s are in the 85-105g CO2 region according to the graph I previously posted. If the car had an occupancy of 2 it would be in the 61-63g CO2 region so less than the train. If the car was at the average occupancy rate of 1.5 it would be in the low 90s, which is more CO2 than a 9 car 222 but less than a 4/5 car 220/221, and likely less than a 5 car 222.
