I think the right answer is 'no'. (So says this evolution website: "These bones resemble those of other mammals, but are only weakly developed in the whale and have no apparent function.") They had a function for whales' ancestors who walked on land in the distant past and needed hip bones for their leg bones to attach to. But lacking legs, whales have no use for hip bones, rendering these structures without function in the present.
This is a problem for evolutionary accounts of function. On these accounts, the function of the whale's hip bones is something like connecting up with the whale's leg bones. That's because evolutionary accounts of function are historical. On such accounts, the selection pressures that caused a particular part to exist are what gives it its function. I'm fine with saying that whale hip bones had the function of connecting with legs in the past, when they were in whale ancestors who had legs. They just don't have it now.
Maybe we could build a better account of function by looking at the way that some part relates to an animal's present interests. This gives many of the same intuitive answers as to what the function of a particular part is, but it deals better with vestigial structures that have lost their function. I don't see any reason why the function of some part needs to connect to the process that produced it -- natural objects that we find can be put to some purpose, and thus acquire a function. If I find a bunch of rocks and use them as ballast in my submarine, their function is to add weight so that the sub will go down, even though that has nothing to do with the process that produced them.