Heya,
Could there be a way to keep the same train ID when reversing the locomotive
No this is a technical limitation of Factorio where locomotives need to be uncoupled to be rotated (coupling and uncoupling causes trains to receive new ID's).
or any way to prevent an uncompatibility with that other mod
Unfortunately no, at least not on my end; However the author of the QoL-TempStations
mod could do something to make it compatible. What they would need to do is register to the on_train_created
event and then update their internal id tracking to the new train id's provided by this event.