They could have stalled or started a resistance against Japan during both wars, but they ended up ordering their army and navy to stand down both times and let the Japanese occupy Korea. The Japanese murdered the queen of Korea in 1895 and they still didn't resist or fight back.
You have to understand the context of both conflicts.
The Sino-Japanese war came about because of a treaty between China and Japan regarding Korea. For centuries, Korea had been a tributary state of China, independent but within their sphere of influence. In 1876, Japan forced Korea to sign the Treaty of Ganghwa which pulled Korea away from Qing China. Ports were opened to Japanese trade and other, heavily biased concessions were imposed on Korea. In 1884, the Gapsin Coup took place. Pro-Japanese collaborators attempted to overthrow the Joseon government. They were put down by Chinese troops and tensions rose between Japan and China. In the spring of 1885, the Convention of Tientsin took place. In it, Japan and China agreed to pull their expeditionary soldiers out of Korea, to recommend that Korea find a third nation to train their forces, and (most importantly to this discussion) that either side would first notify the other if they were to send soldiers into Korea.
In 1894, the Donghak Peasant rebellion began and the Korean government requested help from China. The Chinese entered Korea without telling Japan and helped quash the rebellion. The Japanese declared war and the Sino-Japanese War began.
Why did Korea not fight Japan? They were, as always, "a shrimp stuck between two whales." The Treaty of Ganghwa of 1876 gave the Japanese extra-territoriality, immunity for crimes committed in Korea. Further, between 1876 and 1894, Korea was a tumultuous place. There were riots and attacks and on more than one occasion, Japanese people were caught up in it. In response to the 1882 incident, the "Imo Incident" where graineries were ransacked and the Japanese owners fled, the Japanese government stationed troops in Seoul at their legation/embassy. It's a tough proposition to start a fight when your enemy has forces in your capital.
Furthermore, the reason that the Chinese came into Korea in the first place was that the Korean government was unable to put down a peasant rebellion! They were in no shape to fight the modern Japanese military, both militarily and politically.
Why didn't Korea fight Japan in the Russo-Japanese War? Because Korea was effectively a colony of Japan by that point. Although colonization didn't officially happen until 1910, Japan maintained soldiers in Korea from the end of the Sino-Japanese War and interfered in the politics of Korea (assassination of Queen Min). At the same time, the Korean government was torn between two factions - the pro-Japanese faction and the anti-Japanese faction, which was united only in its opposition to Japan, NOT in how to do it. This disarray played into the Japanese position quite well and they were able to force Korea into complete colonization in 1910.
TLDR - Korea was too weak and Japan had already occupied her.