In the context of expressing deciding/making up your mind *for something*, not just making up your mind, I've seen many structures like 勉強することに心を決めた which means i made up my mind about studying, i committed myself to studying, i decided to do studying
However I've also seen 勉強するのを心に決める which seems to me like it means i decided A in my heart, does this imply you're actively seeking out the act of studying, and you're more emotionally attached to it? Otherwise, these constructs would be totally interchangeable.
To be fair, if you have a sentence that mentions study, heart, and commitment, there aren’t many ways to combine those three concepts. I sometimes feel that students try to make particles carry too much weight. In the wild, context is probably going to play a larger role than particle choice.
If I think of 心に as “in my heart,” that implies a private commitment rather than a public promise. Other than that, I don’t think there’s much difference.
A similar question, does 信じると心に決めた mean "to believe (and/that) my heart has been decided" or "to have decided to believe" with と acting not as "and" but rather as a quotation marker? I'm pretty sure it's the former meaning that is being conveyed