A semi-Lagrangian scheme for Hamilton--Jacobi--Bellman equations on networks