After the Red car, another Blue car starts the pattern again.
Based on common Russian math olympiad styles, here is a logic task for a 2nd grader: logicheskie zadanie po matematike dlia vtorogo klassa
After every Blue car (except the last), there are two Yellow cars. After the Yellow cars, there is one Red car. After the Red car, another Blue car starts the pattern again
4 cars per unit = 28 cars. However, the pattern could end early. If the train ends at the second Yellow car of the 7th unit: . This still maintains the difference. A full 7th unit is After the Red car