Pittsburgh almost had the trifecta. The MLB Pittsburgh Pirates have existed since 1887. From 1925 to 1930 the NHL franchise in Pittsburgh was also known as the Pirates. In 1930 they relocated to Philadelphia and were known as the Quakers. They lasted only 1 year in Philly before getting permission to temporarily cease operations hoping to re-establish in either Philly or Pittsburgh. The Great Depression killed any hopes of that. 3 years after the NHL Pirates left for Philly a new NFL team was formed, also called the Pittsburgh Pirates. They would play as the Pirates until changing their nickname to Steelers in 1940.
In the case of the Cardinals the NFL team started out as the Chicago Cardinals in 1920. 40 years later they took the team and Cardinal name to St. Louis. Cities with 2 teams in different sports carrying the same nickname was commonplace in the 20s and 30s. Around 1924 the Ottawa Rough Riders changed their name to Ottawa Senators for about 3 years. The hockey Ottawa Senators had been around since 1883 and played in the NHL until moving to St. Louis in 1934.
In the early years of the NFL there were several franchises who adopted the names of MLB teams in the same city. Some didn't last long but the Boston Braves, New York Yankees, Brooklyn Dodgers, Detroit Tigers, Cleveland Indians, Cincinnati Reds, Pittsburgh Pirates and New York Giants all were teams in the NFL at the same time as teams of the same name played in MLB. The MLB Giants and NY Football Giants co-existed in New York from 1925 when the latter were formed until 1957 when the baseball Giants moved to San Francisco.
Sidenote the NFL Boston Braves started in 1933 playing in the same park as the MLB Boston Braves. The next year they moved to Fenway, home of the Red Sox. Keeping the Native American theme and I assume recognizing their stadium mates the Red Sox they changed their name to Boston Redskins. In 1937 they moved to Washington.