For each tail node, follow edges until you reach a cycle node. Count steps. This distance tells you how many steps before you are in the cycle. Once in the cycle, you can compute steps to any cycle node modulo cycle length.
The cycle distance is predictable and repeats. Store this distance during preprocessing. It is used in multiple query cases. Computing it on the fly for every query would be too slow.