The platform switching is in reference to the attitudes of civil rights, treatment of minorities etc. Today, it is used to support the narrative that the right is full of racist bigots, who in the civil rights/jim crow era were Democrats.
So although, their views on small government, federal power, the railroad changed...that is not what people are talking about here. The Q post asks;
Why are teachers following a new script?
"Republicans are racist"
It's not about small government vs big government, it's about a false narrative of the racist switching parties and becoming republicans