In this paper, we address a new version of the Uncapacitated Single Allocation p-Hub Median Problem (USApHMP) in which transportation costs on each edge are given by piecewise constant cost functions. In the classical USApHMP, transportation costs are modelled as linear functions of the transport volume, where a fixed discount factor on hub-hub connections is introduced to simulate economies of scale. We argue that, in many cases, it is more realistic to replace the discount factor by decision variables representing the number of vehicles required on the given edge. Introducing integral variables for vehicle numbers makes the resulting optimization problem significantly harder, especially for the existing state-of-the-art MILP solvers. We propose an exact branch-and-bound algorithm where lower bounds are computed by considering a Lagrangian relaxation procedure. The Lagrangian relaxation exploits the problem structure and decomposes the problem into a set of smaller subproblems that can be solved efficiently. In particular, some of the latter can be reduced to continuous knapsack problems that can be solved quickly. We report exact solutions for instances with up to 50 nodes, i.e., significantly larger instances than those solvable by MILP solvers.