Yogananda said that the path adopted to reach God must be scientific and must elevate human consciousness. But Ramakrishna said that there are infinite paths to reach God. How can paths be infinite if they must be scientific, because science is limited?
The quotes you have offered give us an excellent example of how differences can appear to arise between gurus or between different scriptural authorities. Any time we utter a sentence, a noun, verb, and object is required! This, by definition, is expressed in the innate dualism of this world. The great masters like Ramakrishna and Yogananda drink from the perennial spring of cosmic consciousness and then speak from that as they are prompted. Yogananda and Ramakrishna are considered by many to each be an avatar; yet each great teacher has their own role to play and message to bring. They are not at odds with each other.
Yogananda came as a wayshower for the new age (Dwapara) into which humanity has entered. Science is the “religion” of this age. Science here includes reason, proof and evidence, and actual experience. The prior age was characterized by belief, dogma and ritual as well as hierarchy, caste, and royalty. Yogananda’s lineage sent him to bring the practice of kriya yoga: a scientific means by which God can be known. Yogananda is a world teacher for our times and for the centuries to come. Though Yogananda was in himself more of a bhakta, his guru, Swami Sri Yukteswar, prepared him for his mission to the West with a grounding in the science of yoga-meditation. This mixture of reason and feeling can be experienced in Yogananda’s poetry and in his writings.
Such was not the mission of Ramakrishna. Ramakrishna demonstrated by his actual experience that God-contact could be made in all true faiths and spiritual paths. In this way, he too is wayshower for Dwapara, affirming respect and love for all faiths. Though he did not teach yoga or meditation techniques. He was a bhakta and not concerned with the “science” of God-realization. His most famous disciple, Swami Vivekananda, had for his life’s work the combination of teaching the essence of Vedanta truths and emphasizing (especially in India) the necessity of seva (service). When one says the path to God is infinite, that is like one of those expressions Christians use who say “Jesus died for our sins.” The expression is more poetical and sentimental. Certainly there are as many “paths” to God as there are souls, given that each soul is unique. And there’s no harm in saying, by extension, that there are an infinite number of such paths. Such a statement doesn’t preclude the value and even necessity (broadly understood) of yoga-meditation techniques.
Thank you for your inquiry and many blessings upon your path to soul-freedom!