A bipartisan group of senators announced Sunday that it had reached a tentative agreement on legislation that would pair modest new gun restrictions with significant new mental health and school security investments — a deal that could put Congress on a path to enacting the most significant national response in decades to acts of mass gun violence.