Cosmology with Persistent Homology: Parameter Inference via Machine Learning