YOu need sensing in the 1st and last car with 1 wire in between every car to send Dark level to other end so the the darkest level of either becomes the control voltage to drive LEDs for internal ambient light.
Common voltage & ground on track pickup will require regulating with tiny bridge rectifier and 5V LDO for sensor to work in both directions.
Can you ensure reflections in tunnel will not pickup interior light to ambient sensor and cause interference?
Keep in mind, ambient brightness threshold and reference voltage are critical since shadows in cars can interfere with sensor if internal, so must be external.
I suggest this as a tiny 5mm ambient sensor.
https://www.digikey.com/product-detail/en/AMS302/255-2655-ND/2125641
Then choose R base to ground for light sensitivity and buffer with PNP Emitter so that lowest sensor voltage determines drive level of all LED voltage internal light with a suitable pullup R to V+ on track. Then use low side driver to LEDs connected to V+
for example if using string of 3 LEDs per car or 9V, track voltage must be >9V to drive LEDs per car.
then choose R such that if Sensor voltage goes below 2.5V ( from 5V LDO) that MOSFET driver turns on LEDs with Rs=120 Ohms.
- - - Updated - - -
Proof of Concept
The Panasoniic part I suggested is similar to your, but better. CIE spectral filter is a better match to human eye response, but both work the same.
There must be a optical isolation from the interior lighting, otherwise it will interfere with daylight sening.