ASLEF is. RMT isn't - it's affiliated to some party somewhat to the left of Labour, unsurprisingly.
Seriously, which party is that?
The situation in Scotland regarding the affiliation of the RMT how I remember it during the days of Tony Blair's New Labour project was that the RMT had disaffiliated from Labour and became affiliated to the Scottish Socialist Party (SSP).
The SSP had started out in the 1980s as the Scotland wing of the former Militant Tendency, which when they disbanded had became Scottish Turn. Having decided to become involved with electoral politics instead of being on the outside looking in, and with the 1997 referendum to re-establish both the Scottish Parliament and the Senedd in Wales with devolved powers, the SSP fielded candidates for the 1999 Scottish Parliament elections.
The convenor of the SSP at the time was a former member of both Militant and Scottish Turn, who happened to be the suntanned, loudmouth, shouty, fist banging on tables Tommy Sheridan, who was openly a Trotskyist. In 2004, the now defunct Murdoch rag News of the World was running a story on his private life of when he visited a swingers club in the Manchester area, and stepped down as convenor. Sheridan was hell bent on bringing down Murdoch that he alienated a lot of people in the SSP (the allegations were true) and took legal action against the News of the World. In 2010 at the re-trial into the original 2006 trial, Sheridan was found guilty of perjury. In one of the organisations that I am involved with, I know a few individuals who refuse to have any involvement in any project or appear on the same platform that Sheridan is on due to the distress he caused to them from 2004-06.
I am unsure if the RMT in Scotland are still affiliated to the SSP nowadays, or have switched to the SNP or maybe re-affiliated to Scottish Labour Party during the Corbyn tenure.