SNP ministers announced a "temporary" ban on the consumption of alcohol on ScotRail services in 2020 during the covid pandemic.