You can't use the average acceleration. You have to use the actual velocity as shown on the graph.

The distance each vehicle travels is the integral of the velocities shown on the graph w/respect to time.

So compute those two integrals and determine where they are equal.

You're going to have to split the motorcycle integral into pieces, for t = [0,10), [10,15), [15,40) since the velocity changes form across these intervals.