It did indeed take months, and they generally profited from it.
The first thing to understand is that prior to the 20th Century the House (and usually the Senate, except when a new administration was inaugurated and the Cabinet had to be confirmed in a special session) generally only began its first session a full 13 months after the election in December of the following year, prior to which most members just generally just stayed home as a Congressman or Senator-elect during the interim. It would meet until the summer, generally break a few months, and then return for the second, lame duck session, usually from December until March. This allowed Members of Congress to go back home and campaign if they needed, although many (like those on the West Coast) often would stay back East until March.
But what of the travel itself? It was, indeed, brutal. From A Wicked War, Amy Greenberg's colorful guess at Lincoln's 1847 journey from Springfield to Washington to take his House seat should provide an idea:
"Overcrowded coaches bounced and jostled over rutted roads that were dusty in the summer and muddy in the winter. In difficult patches passengers were expected to get out and walk. Travel was totally unregulated and accidents frequent. Undergreased axles broke or caught fire; coaches collided with pedestrians and smaller vehicles, sank into streams or holes, or, dramatically, toppled over, often resulting in serious injuries. On the “splendid turnpikes in Kentucky” (financed with help from Henry Clay) travel was relatively safe, but on the “natural roads” virtually everywhere else, “the pitching from side to side was like that of a small steamer on a coasting trip.” In the best of circumstances passengers could expect to arrive at their destination hungry, thirsty, sleepy, and covered with dust. Grisly accounts of less favorable outcomes were easy to find in local newspapers."
But there was another factor. Members of Congress were reimbursed for their travel at the absolutely astounding amount of $0.40 per mile - about $9.25 today - which meant that pretty much even the most incorruptible members took rather, shall we say, circuitous trips. Lincoln's involved leaving Springfield at the beginning of October, going down the Mississippi on a steamer then back up it and on the Ohio and Kentucky rivers to Frankfort, then to Lexington by train to visit his in-laws the Todds in early November (they spent 3 weeks, and he got to hear Henry Clay make a significant speech in person on November 13th), then back to Frankfort, then on a steamer to Pennsylvania, then by stagecoach to Maryland, then two trains, and finally making it to Washington at the very end of November.
The most direct route for Lincoln was apparently 840 miles by stagecoach. His actual routing that he provided for reimbursement totaled 1626 miles, for which he got paid $1300, or about $30,000 today. This was a major perk of serving in Congress when the pay was set by 1818 statute at the miserly per diem of $8, and it wasn't until 1856 that the pay went up slightly to $3000 per year.
So it's not hard to think of some rather exotic trips for members from California (which was the first West Coast state to join the Union in 1850, with Oregon following in 1859), probably involving trips up to Oregon or Nevada territory and then down to Mexico, South America, and likely everywhere in between on the way to Baltimore (or more likely, New York.) I've never run across of the details of the trips of early West Coast members of Congress, which is understandable - can you imagine what opposition press in those days would have done if they found the itinerary and reimbursement schedule? - but when they could earn double or triple their Congressional salary or more each way with a ~15000 mile trip from New York to San Francisco by sail on the Clipper, I suspect the lucrative travel allowance meant that most were probably quite happy to spend a couple of months at sea as the bookends of their terms.
Edit: another question led me to this gem of an answer by /u/the_alaskan on an additional option for going East-West: beginning in January 1855, if you could afford it, you could shave weeks off the journey by transferring between ships via the Panama Railroad. Here's an archived version of the link he provides.