Sojourn times in a tandem queue with overtaking: reduction to a boundary value problem