Calculating 8bit shift register in puts

Hi
So first off my programming knowledge is quite small I haven't fully learnt c or c++ but and I'm Def trying to run before I can walk.

So project is quite a complex one ( I know biginners mistake)

Basically the project is based at a minute railway. Where we have a loop. Train comes in from two potential directions and leaves from two potential directions.

Additionally. If the train leaves for route C. A gate needs to be closed then reoppened when the train in clear of the gates.

So far I'm working with the intention to use 5 8bit shift register connected to two ardinos. One connected to 3shifts and the second connected to the remaining 2shift registers.

The main issue I'm currently having is the calculation end.

My intention was to write to the ardino Ram with 12 different addresses. Eg A and A1. So write the input from shift A wait 4 sec then read again this time write A1 then calculate the difference between the two. If A = to A1 then carry on with code if not loop untill A=A1

Is this possible or should I be using rasberi pi?

Can supply current flow diagrams or coding so far if people need it.

Ps I havent' got any ardinos for ovs reasons.

My intention was to write to the ardino Ram with 12 different addresses. Eg A and A1.

A1 is a predefined macro - don’t use that.

This certainly seems like something an Arduino could easily handle, and an RPi would be overkill.