STM32 UART flags with pooling methed
Due to the difference in speed, a buffer should probably be used (as mentioned in the comments). So the below code assumes that code for such a buffer (probably ring buffer) exists with this API:
bool buffer_is_empty();           // returns true if buffer is empty
bool buffer_is_full();            // returns true if buffer is full
uint8_t buffer_remove_byte();     // removes and returns the oldest byte added to the buffer
void buffer_add_byte(uint8_t b);  // adds a byte to the buffer

The main loop works byte by byte:

If a byte is available on UART3, receive it and add it to the buffer
If UART2 is ready and the buffer is not empty, remove a byte and transmit it

It could look like so:
uint8_t ch;

while (1) {

    if (__HAL_UART_GET_FLAG(&amp;huart3, UART_FLAG_RXNE) != 0) {  // not empty
        HAL_UART_Receive(&amp;huart3, &amp;ch, 1, 1);
        if (!buffer_is_full()) {
            buffer_add_byte(ch);
        } else {
            // buffer overflow - discard byte
        }
    }

    if (!buffer_is_empty() &amp;&amp; __HAL_UART_GET_FLAG(&amp;huart2, UART_FLAG_TXE) != 0) {
        ch = buffer_remove_byte();
        HAL_UART_Transmit(&amp;huart2, &amp;ch, 1, 1);            
    }
}