Since they were defeated on the home front, why did they still fail?
The thing about Crimea is that it is mountainous territory and at the time aside from Sevastapol the nearest Russian base was in Simferopol, which in turn relatively isolated from other Russian territories. British and French troops on the other hand were supplied by sea and as they made progress inland by a railway that was specifically built by the British to funnel supplies from the sea. Thus while the Russians were still scrambling to bring in their troops from all parts of the empire on foot and what little railways were available, the British and French force were able to resupply from Turkish ports onto Allied ships in the Black Sea to reach a British railway that headed directly to the front lines.
The second thing was the sheer superiority of the British and French troops over those of the Russians. The Minie Ball was far more accurate and deadly than anything the Russians had at the time, and allowed outnumbered British troops to keep up a rate of accurate fire despite being stretched to dangerously thin lines. In the skirmish known as the "Thin Red Line," the British troops extended their line such that it was only 3 man deep rather than the usual 6 against a cavalry charge. The reason for having the line 6 men deep was to present a larger thicker mass that would cause the horses in a charge to turn away from the sheer mass. By having it only 3 men deep, this risked having the horses simply tearing through the line through sheer momentum, thus breaking the cohesion and eventually morale of the unit. However, this paid off, as the increased length of the line was able to put far more firepower into the incoming cavalry so as to rout them before they reached the infantry.
Lastly, there was large amounts of unrest in the Russian territories. Poland, Finland, Ukraine, and Central Asia were all fermenting with unease at being under Russian rule. The sheer military expense of moving all the forces around and of fighting a war for two years also proved to be heavily damaging to the Russian economy. Lastly, a new Tsar has ascended the throne, along with the ensuing instability caused by any change in ruler. It was politically convenient to end the war for the Russians, as doing so would allow them to stop the economic hurt, repacify the restless territories, and give time for the Tsar to consolidate his rule.