Leadbelly, in his song about the Titanic, said that Jack Johnson, who was denied entry to the Titanic because of his race (not worried if this is a historical fact or not, but it would be interesting to find out) got the news that the Titanic had sunk, and "did the Eagle Rock" in celebration. The song was written 40 years before anything like Rock and Roll existed. What was "The Eagle Rock" in the context of a Blues singer from 1912? The song describes blatant racism. Are there other times Leadbelly rails against racism in his other music? Was this a risky subject to write about and sing in those days? I'll link to a recording of the music in a comment in case such links aren't allowed here.
Firstly, the eagle rock was a dance move that was popular from the 1910s. In Debra Devi's book The Language of The Blues: From Alcorub To Zuzu, she quotes a 1913 vaudeville tune called 'Ballin' The Jack' which has lyrics that describe what the Eagle Rock entails:
First you put your two knees close up tight
Then you sway 'em to the lieft
Then you sway 'em to the right
Step around the floor kind of nice and light
Then you twist around and twist around with all your might
Stretch your lovin' arms straight out into space
Then you do the Eagle Rock with style and grace
She also mentions the eagle rock being namechecked in a Bessie Smith song ('Baby Doll') from 1926, and in fact Lead Belly has another tune, 'Eagle Rock Rag' which is fairly obviously meant to be a dance tune that might accompany dancers doing the eagle rock dance moves.
As to racism and the blues, there's not a whole lot of blues tunes that specifically discuss racism, though they do exist (e.g., the verse about Jack Johnson in Lead Belly's 'Titanic', as you've noticed). Others include J.B. Lenoir's 'Eisenhower Blues' and Julia Moody's 'Mad Mama's Blues'. Most fascinating is Howlin' Wolf's 1973 tune 'Coon On The Moon' which features the prophetic lyrics:
You know they call us, 'coon'
Say we didn't have no sense
You gon' wake up one mornin'
An the ol' 'coon' will be your president
Chester Burnett (a.k.a Howlin' Wolf) was born in 1910, and played shows around the Mississippi Delta with the likes of Robert Johnson in the 1930s before eventually moving to Chicago as part of the Great Migration and becoming a star based on his singles released on Chess Records.
So why did so few blues artists openly discuss racism? Well, in Lead Belly's case, he was a sort of leftist cause celebre, plucked from prison and then managed by the song collector Alan Lomax. In the social circles that Lomax circulated in, it was fairly well-established that black people in the South suffered tremendously under Jim Crow; Leadbelly was probably encouraged by Lomax to discuss social issues, and mention racism in song (while still not quite understanding his own paternalistic racism towards Lead Belly).
Otherwise, most of the 1920s and 1930s blues recordings came to be through a sort of dance between record producers and the musicians themselves. Despite popular belief, most of the blues musicians recorded in this period weren't primitive 'blues musicians' as such; they were instead usually working musicians who could play a wide variety of music in a variety of (live) contexts. However, when record companies began to try to sell to 'ethnic' markets (including black people in the South), they wanted music that was novel - new songs that their competitors hadn't already recorded. The blues was a relatively easy song-form to improvise over, or where it was not obvious if you had adapted another song with some minor changes. As such, the blues musicians recorded in the 1920s and 1930s would effectively make up blues on the spot in the (makeshift) recording studios they found themselves in. Being produced and recorded by white people, and being at the recording studio for the purposes of making some money, it may be that the blues musicians might have shied away from too-political statements, most of the time.
But blues musicians didn't need to worry very much about getting political, because the blues is intrinsically about racism (as Fred Hay argues in the article 'Blues What I Am: Blues Consciousness and Social Protest'). Let's face it, the intended audience of the music did not need to hear lyrics about the specifics of racism for the music to resonate with their experiences with being brutally oppressed by white America - they felt it. You may have heard some of the controversies about whether white men can sing the blues (the British comedy band the Bonzo Dog Doo-Dah Band made fun of the by-then quite cliched controversies over this in the 1960s by recording a song called 'Can Blue Men Sing The Whites'?). And of course, the reason why there's controversy is that there's a school of thought that to sing the blues, you have to feel the blues. And you can't really fully feel the blues, goes the logic, unless you've been brutally oppressed by White America (especially in the South).
It's not coincidental that the blues is the most African of American music forms, with blues singers playing 'blue notes' that don't exactly fit in the standard Western musical scale, and various parts of the music seemingly carrying echoes of West African musics that would have once been played by the ancestors of the bluesmen before they were enslaved and transported to America. But basically, in 1920s and 1930s white America, there's very little discussion of blues musicians, as we would currently understand the idea. Sure, there's swing bands - often white ones - playing tunes that have the word 'blues' in the title, but that's jazz; mostly, the likes of Robert Johnson or Lead Belly or Blind Lemon Jefferson were basically only known by white people who were real connoisseurs of African-American music styles, like John Hammond, who organised the From Spirituals To Swing concert in 1938, which was originally planned to feature Robert Johnson before he passed away (and ended up featuring Big Bill Broonzy and Sonny Terry). Instead, it was with record collectors in the late 1940s and then the explosion of 'urban folk' in the 1950s and early 1960s - and the rise of things like the Newport Folk Festival - where white people became aware of blues musicians like Muddy Waters or Mississippi John Hurt.
So, probably, a blues musician could have had lyrics that openly discussed racism, and nobody would have batted an eye - white people just weren't paying attention. But they didn't need to say it out loud, because its intended audience knew it was about racism, because they personally felt the same emotion that was at the core of the music. Take Texas Alexander's 1927 'Levee Camp Moan Blues', which features the lyric:
'Oh, they accused me of forgery and I can't even write my name.'
On the surface, that line is not about racism in quite the same way as Lead Belly discussing Jack Johnson...but, sung the way it was sung, its intended audience would have understood exactly who 'they' were, and exactly why Alexander was illiterate, and the implications of it all.
Link to a recording of Leadbelly singing "The Titanic" https://www.youtube.com/watch?v=hNlnl8nbfSE