Rivian beat Wall Street's fourth-quarter earnings expectations and achieved its first gross quarterly profit but is forecasting lower sales in 2025.