It's important to note that a court (local, national or international) still depends on governments to enforce it rulings. When it comes to enforcing international court rulings, diplomatic support and military strength of a country matters to stand up to another powerful nation state (like one the permanent members of the UNSC).
The Bangladesh liberation war offers good insights on this.
When British India got its freedom, it was partitioned into 3 parts - West Pakistan (now Pakistan), India and East Pakistan (now Bangladesh). West Pakistan and East Pakistan were not geographically connected, and were linguistically and culturally different. West Pakistan, then under a military dictatorship, started a witch hunt against the politicians of East Pakistan that democratically opposed its attempt to impose its cultural hegemony on East Pakistan. This unfortunately turned into a genocide. Millions of Bengalis started pouring into India. India then was struggling to feed its own nation, and was suddenly burdened with taking care of millions more. The stories of violence and undemocratic reprisals of political rights from the refugees also inflamed public anger in India. India urged the great powers to take actions, but they had their own political reasons to not do so.
In particular, the United States of America, then under President Nixon, and an ally of Pakistan was absolutely loathe to act against Pakistan. Nixon was using Pakistan (or he thought he was - it is now clear that Pakistan made better use of him) to somehow open a diplomatic relation with China to try and pivot it against Russia. He thus didn't want to upset them.
Burdened with 10's of millions of refugees that continued to pour into India, and public anger rising against the Pakistanis and the Government of India, India's Government under Mrs. Indira Gandhi decided it had no option but to seek a military solution to force a political settlement. But Pakistan had 3 permanent members of the UNSC as its ally - the US, UK and China. And both US and UK had directly warned the indian Prime Minister that they would not tolerate any military actions by India (though UK was more sympathetic to both India and Bangladesh's political situation). China had fought a war with India, believed that the USSR was using India to increase its influence in the area, and also as an ally of Pakistan, was also hostile to India.
To make a long story short, Mrs. Indira Gandhi decided to do a personal outreach as part of an international diplomatic mission to highlight the genocide happening in East Pakistan / Bangladesh, and advocate support for the Bengalis, and to push forward India's views that a military solution was increasingly inevitable in the absence of a negotiated political settlement by the international community. At the same time, on rightly perceiving the western hostility to her military plans, India pragmatically abandoned its non-alignment foreign policy and signed a temporary military pact with Russia.
The indian military had started equipping itself and training Bengali rebels. Pakistan launched a pre-emptive strike against India, immediately escalating the issue. India and Bengali rebels worked together together and defeated both the invading army from West Pakistan and the occupying army in East Pakistan. When the US threatened to attack India, Russia stepped up and warned the US that it would get involved too due to military pact with India. This ensured that the west dropped its plans to attack India. At the same time, the international diplomatic mission had managed to create a huge support for the independence and creation of Bangladesh.
While India's international diplomacy under Mrs. Indira Gandhi was at its finest during this period, the role of the Bangladeshi's were also exceptional and important in diplomacy during this period. A consequence of West Pakistan's genocide was that many East Pakistan diplomats in Pakistan embassies around the world rebelled and turned against them. The words of these diplomats, who had better access to what was actually happening in East Pakistan / Bangladesh, carried a lot of weight among the international community and was instrumental in earning international support for India and Bangladesh.
This has some parallels with the Russian - Ukraine crisis currently ongoing in Europe. Ukraine, thanks to its NATO allies, has managed to win considerable support among the international community. Ukraine has also shown to the world that it has a capable military. It also has a military alliance with the NATO. These exact factors - a capable military, strong international support, a military alliance with a P5 member - are what helped India stand up to the Nixon's USA in liberating Bangladesh.
So the answer to your question is that if Ukraine can persist in maintaining the support of the international community, its military alliance with NATO (which includes many P5 members) and maintain the capability of its military, Ukraine could very well be in a position to enforce any international court ruling against Russia. (Atleast some parts of it anyway, realistically, as Russia is still considerably powerful).