Minecraft – Need help with redstone logic memory cells

minecraft-java-editionminecraft-redstone

I need some advice if possible regarding making a memory cell, specifically what type of memory cell I should look at employing. I assume I want a T-Flip-Flop but I'm not too sure.

Basically the switch is going to be used as a track selector for a rail system, each location is connected to at most two other stations. What I'm attempting to do is probably best explained in a picture:
enter image description here

As you can see I would like to have the current state of particular junction saved in a particular state. When a button is pressed it toggles the state of that lever which is then saved again. I'm assuming for this I would want a T-Flip-Flop switch and I would need to feed the input buttons from all stations to meet at the input end of this switch, would that be correct?

Best Answer

Was able to answer my own question I think articulating it in words helped. In anyone else is coming across this then a flip flop switch will indeed work, in order for a button at any location to work simply feed it into the input end before the switch and it will work just fine.