Yes, airlines have some wacky pricing. At least Amtrak seems to base it by distance traveled and popularity of the route. Airlines are a little more nebulous. When booking a flight, I noticed that I was changing planes in a city that was a short train ride away from my destination. I thought, "How much can I knock off of my airfare by just skipping that last leg and getting on the train." The answer was that my fare would have tripled because now I'm taking a direct flight with no transfers. That's when I realized that the airlines didn't place a value an a certain seat on a certain flight. Instead the value was based on how much they inconvenienced me in the process. A direct flight costs more because it's more convenient. An indirect flight that incorporates that exact flight costs less because I have to take more planes.
When I realized that the airlines were charging me more just to not deliberately inconvenience me, I booked the trip entirely on Amtrak.
In general, airline ticket prices are based neither on the value of individual flights, nor on the level of inconvenience. They are based on individual markets and the level of demand and competition for those markets.
For an overly simplified explanation, a flight AAA-BBB-CCC is priced based on the fares for AAA-CCC. The airline flying AAA-BBB-CCC has to consider the overall market for AAA-CCC, and also consider what the competition is charging. The competition may fly AAA-DDD-CCC, or sometimes even AAA-EEE-FFF-CCC. But, ultimately, when an airline is quoting a fare, they are quoting it for AAA-CCC, regardless of what potential market combinations may exist for connections in the middle.