There is no clear distinction of meaning. “Im” is the most usual preposition; “am” and “beim” are much less frequent - perhaps there is an influence of region or period.
Morgengrauen is the earliest part of dawn, with the barest hint of sunlight. Also sometimes used figuratively for the physiologically lowest point of the day, at about that time.
Maybe this is entirely specious, but to me “im” carries an overtone that the rest of the sentence is more concerned with some event or person in place and location, 'am" with a point in time, and “beim” with the process of growing light.
‘Im’, ‘am’, and ‘beim’ are actually contractions of ‘in dem’, ‘an dem’, and ‘bei dem’, where ‘dem’ is the dative singular article. ‘In’, like in English, then carries a connotation of containment—inside, within, perhaps also during when applied to something of temporal extension, like dawn (‘Morgengrauen’). ‘An’, on the other hand, in a spatial case, would connote proximity, close to English ‘at’, also to denote a point in time (‘at dawn’). ‘Bei’, to me, is similar—compare ‘at the’ or ‘by the’, for a rough sense of the relation between ‘an’ und ‘bei’, but in a temporal sense, connoting something like co-occurrence.
So ‘im Morgengrauen’ would be something like ‘during dawn’, while I’d understand ‘am Morgengrauen’ to mean something like ‘upon dawn’, and ‘beim Morgengrauen’ as ‘while it is dawning’. But that’s possibly a little idiosyncratic.