This looks like it may be a homework problem, so instead of writing out the code for you, I'll try to explain where you've gone astray in thinking about your code.
When you write for (i in X1), you are instructing i to iterate over the values in X1. So i will take on the values 1, 2, 3, 4, 5, and 6. j will do likewise, and so your loop will iterate exactly 36 times. As it is written, your loop cannot iterate 10000 times.
Thus, you may want to iterate over something other than X1 and X2.
My hint would be to use the following code
Y <- vector("numeric", 10000)
This assigns a vector of 10000 values to Y. Each value starts at zero, but can be replaced, with an expression of Y[i] <- ... where i is the element to be replaced. In a for loop, you can iterate over the length of Y with for (i in seq_along(Y))
Lastly, in order to simulate your dice, you can succinctly simulate the ratio of X1 to X2 with
sample(1:6, 1) / sample(1:6, 1)
If you can do that 10000 times and assign it to Y, you'll be on your way to a solution.