It is entirely possible, however it does require you to learn nuances of that caste. Otherwise you will get caught out especially while discussing with elders. That said when it comes to marriage there’s no way to hide your caste. The priest knows your parents their relatives and what not. Their surnames being different will cause all kinds of red lights to go off.
Also, for governmental purposes you are expected to produce “caste certificate” which you can’t forge. So it’s not unusual for people in India to marry into lower caste to reap the benefits of governmental reservation.
So, the answer is nuanced. If you want to take advantage of surname in a private company like say Cisco then go for it. For any other purpose, changing surname alone isn’t sufficient. In fact it’s impossible to hide your caste.
While we are at it, it’s worth noting that “caste” refers to two distinct and intertwined hierarchical structures called “varna” and “jati”. Which means even among Brahmins (the upper most caste, intact Brahmin is a Varna and not Jati) there’s a hierarchy, priest being the top most. Jatis are sometimes referred as “sub-caste”.
This Jati is so pervasive in India that even the non-Hindu religions such as Sikhism and “Lingayat” which were explicitly formed to be away from the Hindu caste system couldn’t escape it. So we now have a few dozen Jati within Sikhism and Lingayats with an overly of Verna.
As an academic topic it’s a fascinating one. The roots of this codified structure is still not clear, it’s an active area of research. Recent advancements in human evolutionary genetics is revealing some interesting insights but long way to go.
So if you aren't a brahmin, you probably haven't had the same childhood experiences of temple-going and specific rituals. If I really want to ferret your caste out, I might casually quiz you on this background, maybe even in the context of innocently joshing about, "hey, wasn't that weird our moms would make us do blah blah blah." And if you didn't respond right away with a story about how your parents did that same thing, I'd maybe start to become suspicious ...
If you ever let slip that someone in your family got a job because they utilized an affirmative action program (called "reservations" in India,) it'd sound weird, and I'd get suspicious ...
If I started a joke about how some brahmins are better than other brahmins (yep, that exists. I know because I am the best Brahmin.) and you seemed clueless about the typology, I'd get suspicious ...
You do this enough times, I'm gonna cross you off my party list.