This is an interesting rigging challenge. I have limited Max script experience but thought I would give it a try so here is my work-in-progress partial solution.
In the attached file a green box represents the bus (trolley) and a red cylinder the boom from the bus to the overhead cable. PointBus is a point linked to the bus and is at the location of the boom. Boom is also linked to the bus and has a LookAt constraint pointing at PointCable

The following script can be used to position PointCable on the cable a distance L (the length of the boom) from PointBus.
-- positions PointCable on line001 a distance LabelControl
-- from PointBus
-- v .01 2/6/2022 L. Minardi
select $line001
cable = $
select $PointCable
pCable = $
sM = [0,0,0]
global delta = 0.1
global s = delta
global L= 20.
select $Bus
BusT = $.transform
select $PointBus
pBus = $.position
sA = 0.0
sB = delta
flag = true
pA = interpCurve3D cable 1 sA
pB = interpCurve3D cable 1 sB
dA = distance pBus pA
dB = distance pBus pB
-- get to intervale containing solution
for i = 1 to 10 while flag do
(if dB > L then
(
pA = pB
sA = sB
sB = sB + delta
pB = interpCurve3D cable 1 sB
dB = distance pBus pB
)
else
( flag = false
)
)
-- now iterate between A and B
flag = true
for i = 1 to 5 while flag do
(
sM = (sA + sB)/2.
pM = interpCurve3D cable 1 sM
dM = distance pBus pM
err = abs(dm - L)
if (err < (0.01 * L)) then
( flag = false
format ("i = %, error = % ") i err
)
if dM < L then
(
pB = pM
sB = sM
)
else
(
pA = pM
sA = sM
)
) -- end for
pCable.pos = pM
The program searches the cable from its end to a location delta along the cable. It does not examine the entire cable at the start because there could be multiple solutions and we seek the point that will keep the boom to towards the rear of the bus. An interval pA to pB is examined and if both points are further from PointBus then L, then pA become pB and a new pB is determined a distance delta along the cable from pB. The search is continued until the segment where distance to pA is greater than L and the distance to pB is less than L. This interval is then searched using the bisection numerical approach to find point pM, midway between pA and pB that is within sufficient tolerance.
There are several implied assumptions in this solution including that the first end of the cable is closest to the desired direction of the boom.
Experiment with the attached file by moving the bus and then executing the script. Please let me know if this approach looks like it has promise and what modifications you would like to see.
lee.minardi