The answer is slightly more complex than what the OP proposes -- this is due to two factors:
The interconnect must be fail safe -- i.e. if the interconnect circuit fails, the system must be able to detect this and report a problem to both highway and railroad maintenance crews. To this end, special supervised circuits are used, using two relays in opposite states to detect a failure of any single relay to operate correctly.
The interconnect must trigger the traffic light preemption cycle sufficiently before the railroad crossing signals trigger to allow queues to clear off the track before the train arrives. This may require both extended advance warning times (in excess of the 20 second regulatory minimum) and the use of advance warning outputs from the railroad grade crossing predictor -- just about all constant warning time predictors support advance preemption, but older DC or AC/DC three-track-circuit systems and Audio Frequency Overlay detectors may not.
Furthermore, there are special programming concerns on the highway side as well -- the grade crossing preemption cycle must be set up correctly to provide sufficient track clearance green before it blocks all movements over the grade crossing, either using red arrows or illuminated blank-out signs to prohibit turning movements onto the tracks, while also allowing pedestrians to clear from the railroad crossing (this can be critical in geometries where the railroad crossing bisects or is in close proximity to the intersection).
Preemption reservice (where the traffic signal controller handles a second preemption request that closely follows the first) and extra logic on both sides (highway and rail) may be necessary when multiple tracks or switching movements are involved, and coordinated signalization and preemption are needed when multiple traffic signals are in close proximity to the grade crossing. Diagonal crossings (either cutting multiple approaches or bisecting the intersection) pose even more challenges, sometimes requiring multiple grade crossing predictors to be interconnected to each other as well as to the highway traffic signal controller.
If you want more gory detail on the intricacies of this than you ever need, the FHWA has an excellent handbook chapter on this topic. In particular, Exhibit 3 in the pre-emption sidebar (reproduced below) provides a sample diagram of a fail-safe interconnect relay circuit.