SICRET: Supernova Ia Cosmology with truncated marginal neural Ratio EsTimation