X and Y can cost the same amount and solve different amounts of pain and both be priced accurately.
How?
Amount of Pain X Solves < Amount of Pain Y Solves
X solves a problem for a small market where the consumers are still find it worth $25 to solve the problem and have less options.
Y solves a massive problem that a lot of people have (big market). Prices have been driven to $25 by many competitors.
Different amounts of pain, different amounts of complexity, same price. Y's price has been driven down to 25 by competitive factors. X's price is higher because a lack of competitors. All this requires is that one is under-priced relative to value delivered but not to the market's competitive forces. Therefore neither is under priced given the reality of both sides of the market.