Please identify this vaguely-remembered book for me

It’s a fantasy book, with magic etc but it starts off in what appears to be the British Raj. I think the protagonist is female, as is the author.

As I recall it had a good start as you began to realise that this was actually an alternate Earth, then faded somewhat.

My guess is The Blue Swordby Robin McKinley.

That’s the one. Thank you.

The Hero and the Crown, in the same world but much earlier, is better.