Inverse Boundary Value and Optimal Control Problems on Graphs: A Neural and Numerical Synthesis