Hybrid thermostatic approximations of junctions for some optimal control problems on networks