Delegates are bound to vote for the candidate that wins in their respective congressional district.... provided that candidate has not specifically released them. If they have not been released, then the delegate is bound to their district's winning candidate for the 1st ballot at the convention. If that candidate wins at least 35% of the vote on the first ballot, the delegate remains bound to that candidate for the 2nd ballot as well. After the 2nd ballot, the delegate may vote for whomever they wish, irrespective of the number of votes a candidate receives at the convention.
So, suppose a delegate committed to Ron Paul happens to win the delegate race, but some candidate besides Ron Paul wins the popular vote within their congressional district. On the first ballot at the convention, the Ron Paul delegate must vote for the candidate that won the district (not Ron Paul). If that candidate receives at least 35% of the vote on the first ballot, the delegate must again vote for that candidate on the 2nd ballot. If the vote goes to a 3rd ballot, the delegate is released, and may now vote for Ron Paul, and can continue to vote for Ron Paul on subsequent ballots until Ron Paul wins the majority, or some other candidate wins the majority.
I think it's pretty unlikely that a RP delegate will win without RP also winning a district, but it is possible.