  In this paper we study the $L^p$ boundedness of the centred and the uncentred
Hardy--Littlewood maximal operators on the class $\Upsilon_{a,b}$, $2\leq a\leq
b$, of trees with $(a,b)$-bounded geometry. We find the sharp range of $p$,
depending on $a$ and $b$, where the centred maximal operator is bounded on
$L^p(\mathfrak T)$ for all $\mathfrak T$ in $\Upsilon_{a,b}$. We show that
there exists a tree in $\Upsilon_{a,b}$ for which the uncentred maximal
function is bounded on $L^p$ if and only if $p=\infty$. We also extend these
results to graphs which are strictly roughly isometric, in the sense of Kanai,
to trees in the class $\Upsilon_{a,b}$.
